bundlewrap/bundles/octoprint/files/systemd-wrapper
Franzi d02538368a
All checks were successful
bundlewrap/pipeline/head This commit looks good
bundles/octoprint: add systemd-wrapper script
2020-09-22 18:52:11 +02:00

23 lines
381 B
Bash

#!/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