mirror of
https://github.com/hassio-addons/addon-motioneye.git
synced 2025-05-05 11:41:27 +00:00
🔨 Configuration cleanup
This commit is contained in:
parent
40a0d2419e
commit
78f0195d8d
3 changed files with 36 additions and 8 deletions
|
@ -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
|
16
motioneye/rootfs/etc/cont-init.d/31-motion.sh
Normal file
16
motioneye/rootfs/etc/cont-init.d/31-motion.sh
Normal 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
|
14
motioneye/rootfs/etc/motioneye/motion.conf
Normal file
14
motioneye/rootfs/etc/motioneye/motion.conf
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue