LiveCam/systemd/installservice.sh

15 lines
381 B
Bash
Raw Normal View History

2020-08-15 19:31:20 +02:00
#!/bin/bash
2020-08-15 19:21:01 +02:00
if [ "$(id -u)" -ne 0 ]; then
exec sudo /bin/bash "$0" "$@"
fi
2020-08-15 19:21:01 +02:00
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cp $SCRIPT_DIR/livecam-chch.service /etc/systemd/system/livecam-chch.service
chmod 664 /etc/systemd/system/livecam-chch.service
systemctl daemon-reload
2020-08-15 19:21:01 +02:00
# enable and start service
systemctl enable livecam-chch
systemctl start livecam-chch