mirror of
https://github.com/hassio-addons/addon-motioneye.git
synced 2025-05-05 11:41:27 +00:00
🔨 Merged init scripts
This commit is contained in:
parent
d9f8927c7b
commit
9c5d79c63e
2 changed files with 18 additions and 22 deletions
|
@ -1,22 +0,0 @@
|
||||||
#!/usr/bin/with-contenv bashio
|
|
||||||
# ==============================================================================
|
|
||||||
# Community Hass.io Add-ons: motionEye
|
|
||||||
# Configure motion webcontrol access
|
|
||||||
# ==============================================================================
|
|
||||||
readonly motion='/data/motioneye/motion.conf'
|
|
||||||
|
|
||||||
if bashio::config.true 'motion_webcontrol'; then
|
|
||||||
bashio::log.info "Enabling motion webcontrol..."
|
|
||||||
bashio::.log.warning "This opens up an UNSECURE port to the outside world!"
|
|
||||||
bashio::.log.warning "This port has NO SSL & NO AUTHENICATION!"
|
|
||||||
bashio::.log.warning "YOU HAVE BEEN WARNED!"
|
|
||||||
sed -i "s/webcontrol_localhost on/webcontrol_localhost off/" "$motion"
|
|
||||||
else
|
|
||||||
sed -i "s/webcontrol_localhost off/webcontrol_localhost on/" "$motion"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Creates initial motionEye media folder in case it is non-existing
|
|
||||||
if ! bashio::fs.directory_exists '/share/motioneye'; then
|
|
||||||
mkdir -p /share/motioneye \
|
|
||||||
|| bashio::exit.nok 'Failed to create initial motionEye media folder'
|
|
||||||
fi
|
|
|
@ -4,6 +4,7 @@
|
||||||
# Creates initial motionEye configuration in case it is non-existing
|
# Creates initial motionEye configuration in case it is non-existing
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
readonly CONF='/data/motioneye/motioneye.conf'
|
readonly CONF='/data/motioneye/motioneye.conf'
|
||||||
|
readonly MOTION='/data/motioneye/motion.conf'
|
||||||
|
|
||||||
if ! bashio::fs.directory_exists '/data/motioneye'; then
|
if ! bashio::fs.directory_exists '/data/motioneye'; then
|
||||||
cp -R /etc/motioneye/ /data/motioneye/ \
|
cp -R /etc/motioneye/ /data/motioneye/ \
|
||||||
|
@ -27,3 +28,20 @@ if bashio::fs.file_exists "${CONF}"; then
|
||||||
-exec \
|
-exec \
|
||||||
/usr/lib/python2.7/site-packages/motioneye/scripts/migrateconf.sh {} \;
|
/usr/lib/python2.7/site-packages/motioneye/scripts/migrateconf.sh {} \;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Configure motion webcontrol access
|
||||||
|
if bashio::config.true 'motion_webcontrol'; then
|
||||||
|
bashio::log.info "Enabling motion webcontrol..."
|
||||||
|
bashio::.log.warning "This opens up an UNSECURE port to the outside world!"
|
||||||
|
bashio::.log.warning "This port has NO SSL & NO AUTHENICATION!"
|
||||||
|
bashio::.log.warning "YOU HAVE BEEN WARNED!"
|
||||||
|
sed -i "s/webcontrol_localhost on/webcontrol_localhost off/" "$MOTION"
|
||||||
|
else
|
||||||
|
sed -i "s/webcontrol_localhost off/webcontrol_localhost on/" "$MOTION"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Creates initial motionEye media folder in case it is non-existing
|
||||||
|
if ! bashio::fs.directory_exists '/share/motioneye'; then
|
||||||
|
mkdir -p /share/motioneye \
|
||||||
|
|| bashio::exit.nok 'Failed to create initial motionEye media folder'
|
||||||
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue