bundles/octoprint: add systemd-wrapper script
All checks were successful
bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2020-09-22 18:52:11 +02:00
parent 7ea85247e0
commit d02538368a
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,22 @@
#!/bin/bash
systemctl=$(command -v systemctl)
if [[ -z "$systemctl" ]]; then
echo "systemctl not found"
exit 1
fi
if [[ "$1" == "restart-octoprint" ]]; then
$systemctl restart octoprint
elif [[ "$1" == "restart-system" ]]; then
$systemctl reboot
elif [[ "$1" == "shutdown-system" ]]; then
$systemctl poweroff
else
echo "unknown command"
exit 1
fi

View file

@ -32,4 +32,7 @@ files = {
'svc_systemd:octoprint:restart',
},
},
'/opt/octoprint/systemd-wrapper': {
'mode': '0755',
},
}

View file

@ -4,6 +4,7 @@ defaults = {
'home': '/opt/octoprint',
'sudo_commands': {
'/usr/bin/vcgencmd',
'/opt/octoprint/systemd-wrapper',
},
},
},