mirror of
https://github.com/mtan93/homeassistant-addons.git
synced 2026-04-04 14:23:09 +01:00
[AWTRIX] Initial add (#132)
This commit is contained in:
52
awtrix/rootfs/etc/cont-init.d/awtrix.sh
Normal file
52
awtrix/rootfs/etc/cont-init.d/awtrix.sh
Normal file
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
|
||||
runfolder="/data"
|
||||
datafolder="/config"
|
||||
|
||||
bashio::log.info "Addon Version 0.2.6 (Awtrix 2.0 beta)"
|
||||
|
||||
if bashio::fs.directory_exists "${datafolder}"; then
|
||||
if ! bashio::fs.directory_exists "${datafolder}/awtrix"; then
|
||||
mkdir "${datafolder}/awtrix"
|
||||
bashio::log.info "mkdir /config/awtrix"
|
||||
fi
|
||||
if ! bashio::fs.directory_exists "${datafolder}/awtrix/config"; then
|
||||
mkdir "${datafolder}/awtrix/config"
|
||||
bashio::log.info "mkdir /config/awtrix/config"
|
||||
fi
|
||||
if ! bashio::fs.directory_exists "${datafolder}/awtrix/apps"; then
|
||||
mkdir "${datafolder}/awtrix/apps"
|
||||
bashio::log.info "mkdir /config/awtrix/apps"
|
||||
fi
|
||||
if ! bashio::fs.directory_exists "${runfolder}/Apps"; then
|
||||
ln -s "${datafolder}/awtrix/apps" "${runfolder}/Apps"
|
||||
bashio::log.info "ln -s Apps"
|
||||
fi
|
||||
if ! bashio::fs.directory_exists "${runfolder}/config"; then
|
||||
ln -s "${datafolder}/awtrix/config" "${runfolder}/config"
|
||||
bashio::log.info "ln -s" "${datafolder}/awtrix/config" "${runfolder}/config"
|
||||
fi
|
||||
else
|
||||
bashio::log.error "No /config folder"
|
||||
exit
|
||||
fi
|
||||
|
||||
if bashio::config.exists 'lang'; then
|
||||
lang=$(bashio::config 'lang')
|
||||
bashio::log.info "Setting lang to ${lang}..."
|
||||
export LANG=${lang}
|
||||
fi
|
||||
|
||||
cd $runfolder
|
||||
|
||||
version=$(bashio::config 'version')
|
||||
|
||||
bashio::log.warning "disabling hassio-detection"
|
||||
export SUPERVISOR_TOKEN=-1
|
||||
|
||||
bashio::log.info "Starting awtrix (${version})..."
|
||||
|
||||
exec /usr/bin/java -jar /$version.jar --logger=stdout &
|
||||
|
||||
|
||||
|
||||
18
awtrix/rootfs/etc/cont-init.d/nginx.sh
Normal file
18
awtrix/rootfs/etc/cont-init.d/nginx.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: grafana
|
||||
# Configures NGINX
|
||||
# ==============================================================================
|
||||
declare ingress_entry
|
||||
declare ingress_interface
|
||||
|
||||
bashio::log.info "Configuring NGINX"
|
||||
|
||||
ingress_interface=$(bashio::addon.ip_address)
|
||||
sed -i "s/%%interface%%/${ingress_interface}/g" /etc/nginx/servers/ingress.conf
|
||||
sed -i "s/%%interface%%/${ingress_interface}/g" /etc/services.d/nginx/run
|
||||
|
||||
ingress_entry=$(bashio::addon.ingress_entry)
|
||||
sed -i "s#%%ingress_entry%%#${ingress_entry}#g" /etc/nginx/servers/ingress.conf
|
||||
|
||||
|
||||
Reference in New Issue
Block a user