forked from j-a-n/homematic-addon-hue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hue
executable file
·55 lines (46 loc) · 1.36 KB
/
hue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh
ADDON_NAME=hue
CONFIG_DIR=/usr/local/etc/config
ADDON_DIR=/usr/local/addons/${ADDON_NAME}
RCD_DIR=${CONFIG_DIR}/rc.d
case "$1" in
""|start)
echo "Starting hue daemon..."
${ADDON_DIR}/hued.tcl
;;
stop)
echo "Stopping hue daemon..."
${ADDON_DIR}/hued.tcl stop
;;
restart)
echo "Restarting hue daemon..."
${ADDON_DIR}/hued.tcl
;;
info)
version=$(cat ${ADDON_DIR}/VERSION)
echo "Info: <b>${ADDON_NAME} addon</b><br>"
echo "Info: <a href='https://github.com/j-a-n/homematic-addon-hue' target='_blank'>https://github.com/j-a-n/homematic-addon-hue</a>"
echo "Name: Philips Hue"
echo "Version: ${version}"
echo "Operations: uninstall"
echo "Config-Url: /addons/${ADDON_NAME}"
echo "Update: /addons/${ADDON_NAME}/update.cgi"
;;
uninstall)
logger -t homematic -p user.info "removing addon ${ADDON_NAME}"
"/usr/local/addons/cuxd/update_addon" ${ADDON_NAME} || true
[ -e "${ADDON_DIR}" ] && rm -rf "${ADDON_DIR}"
[ -L "${CONFIG_DIR}/addons/www/${ADDON_NAME}" ] && rm "${CONFIG_DIR}/addons/www/${ADDON_NAME}"
if [ -e "${RCD_DIR}/${ADDON_NAME}" ]; then
mount -o remount,rw /
rm -f ${RCD_DIR}/${ADDON_NAME}
mount -o remount,ro /
fi
[ -e "/usr/local/addons/${ADDON_NAME}-install.log" ] && rm -rf "/usr/local/addons/${ADDON_NAME}-install.log"
;;
*)
echo "Usage: $0 {start|stop|restart|uninstall}" >&2
exit 1
;;
esac
exit 0