🔨 Configuration cleanup

This commit is contained in:
ludeeus 2019-01-04 14:44:12 +01:00
parent 40a0d2419e
commit 78f0195d8d
3 changed files with 36 additions and 8 deletions

View file

@ -7,15 +7,13 @@
source /usr/lib/hassio-addons/base.sh source /usr/lib/hassio-addons/base.sh
if ! hass.directory_exists '/data/motioneye'; then if ! hass.directory_exists '/data/motioneye'; then
cp -R /etc/motioneye /data/motioneye \ cp -R /etc/motioneye/ /data/motioneye/ \
|| hass.die 'Failed to create initial motionEye configuration' || hass.die 'Failed to create initial motionEye configuration'
fi fi
if hass.config.true 'motion_api'; then
hass.log.info "Enabling motion webcontrol" # Needed for existing installations.
sed -i "s/motion_control_localhost true/motion_control_localhost false/" \ if ! hass.file_exists '/data/motioneye/motion.conf'; then
"/data/motioneye/motioneye.conf" cp /etc/motioneye/motion.conf /data/motioneye/motion.conf \
else || hass.die 'Failed to create initial motion configuration'
sed -i "s/motion_control_localhost flase/motion_control_localhost true/" \
"/data/motioneye/motioneye.conf"
fi fi

View file

@ -0,0 +1,16 @@
#!/usr/bin/with-contenv bash
# ==============================================================================
# Community Hass.io Add-ons: motionEye
# Configure motion webcontrol access
# ==============================================================================
# shellcheck disable=SC1091
source /usr/lib/hassio-addons/base.sh
readonly motion='/data/motioneye/motion.conf'
if hass.config.true 'motion_api'; then
hass.log.info "Enabling motion webcontrol"
sed -i "s/webcontrol_localhost on/webcontrol_localhost off/" "$motion"
else
sed -i "s/webcontrol_localhost off/webcontrol_localhost on/" "$motion"
fi

View file

@ -0,0 +1,14 @@
# @enabled on
# @show_advanced off
# @normal_password
# @admin_username admin
# @admin_password
# @normal_username user
webcontrol_localhost on
thread thread-1.conf
webcontrol_html_output off
webcontrol_port 7999
setup_mode off
webcontrol_parms 2