Franziska Kunsmann
d02538368a
All checks were successful
bundlewrap/pipeline/head This commit looks good
22 lines
381 B
Bash
22 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
|