forked from homematic-community/hm-print
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate_script
executable file
·43 lines (34 loc) · 991 Bytes
/
update_script
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
#!/bin/sh
RC_DIR=/usr/local/etc/config/rc.d
WWW_DIR=/usr/local/etc/config/addons/www/print
ADDON_DIR=/usr/local/etc/config/addons/print
# check for unsupported platforms
if grep -qim1 busmatic /www/api/methods/ccu/downloadFirmware.tcl; then
exit 13
fi
# mount /usr/local if not already mounted
mount | grep /usr/local 2>&1 >/dev/null
if [ $? -eq 1 ]; then
mount /usr/local
fi
# Startscript anlegen
cp -af rc.d/programmedrucken ${RC_DIR}/
chmod +x ${RC_DIR}/programmedrucken
# Web-Konfiguration anlegen
mkdir -p ${WWW_DIR}
cp -af www/* ${WWW_DIR}
chmod 755 ${WWW_DIR}
# Addon-Verzeichnis anlegen
mkdir -p ${ADDON_DIR}
cp -af addon/* ${ADDON_DIR}
chmod 755 ${ADDON_DIR}
# Symbolic Links
rm -f ${WWW_DIR}/VERSION.txt
ln -sf ${ADDON_DIR}/VERSION ${WWW_DIR}/VERSION.txt
rm -f ${WWW_DIR}/addon
ln -sf ${ADDON_DIR} ${WWW_DIR}/addon
# sync filesystem to make sure all changes are written to disk
sync
if [ "$1" = "HM-RASPBERRYMATIC" ]; then
/etc/config/rc.d/programmedrucken start
fi