42 lines
931 B
Bash
Executable File
42 lines
931 B
Bash
Executable File
#!/bin/bash
|
|
|
|
#set -e
|
|
case "$1" in
|
|
configure|abort-upgrade)
|
|
|
|
id -u vid &>/dev/null || useradd --system -m vid
|
|
|
|
runuser -l vid -c "pip3 install -r /usr/share/hyperdeck/requirements.txt"
|
|
|
|
|
|
|
|
FILE="/etc/hyperdeck/config.json"
|
|
SOURCEFILE="/usr/share/hyperdeck/config.json.orig"
|
|
if [ -f "$FILE" ]; then
|
|
echo "$FILE exists."
|
|
else
|
|
mkdir -p /etc/hyperdeck/
|
|
echo "Copy default config"
|
|
cp "$SOURCEFILE" "$FILE"
|
|
chmod 744 "$FILE"
|
|
fi
|
|
|
|
|
|
|
|
systemd-notify --booted
|
|
if [ "$?" -eq 0 ]
|
|
then
|
|
echo "Systemd running, registering service"
|
|
systemctl daemon-reload && systemctl enable hyperdeck
|
|
else
|
|
echo "Systemd not running, skipping"
|
|
fi
|
|
|
|
mkdir -p /var/log/hyperdeck/
|
|
chown vid:vid "/var/log/hyperdeck/"
|
|
|
|
echo "Installation done"
|
|
;;
|
|
esac
|
|
exit 0
|