-
-
Notifications
You must be signed in to change notification settings - Fork 108
How to use shutdowns
Shutdown consist out of two fields: Shutdown Cron
and Shutdown Cmd
.
-
Shutdown command
is the shell command which is triggered by cron which is ran inside the container (if you use docker) or on your host (if you use the binary). This command will also be executed when you click the green power button on the homepage to shutdown your device. -
Shutdown Cron
is a common cron expression when to trigger the shutdown command. You can easily create your expression at crontab.guru. This can either be enabled or disabled with the toggle to the right.
To test the shutdown command you can exec into your container with docker exec -it upsnap sh
, then run your command. Default packages to use are sshpass
to shutdown linux computers or net rpc
to shutdown windows computers.
If you need additional packages to shutdown computers, that do not ship by default with the container, add the following line to your docker-compose.yml:
entrypoint: /bin/sh -c "apk update && apk add --no-cache <YOUR_PACKAGE> && rm -rf /var/cache/apk/* && ./upsnap serve --http 0.0.0.0:8090"
You can search for your package here.
Shutdown computer at 04:05.
- Cron set to
5 4 * * *
- Cmd set to
net rpc shutdown -I 192.168.1.13 -U "user%password"
Shutdown computer at 22:00 on every day-of-week from Monday through Friday.
- Cron set to
0 22 * * 1-5
- Cmd set to
sshpass -p your_password ssh -o "StrictHostKeyChecking=no" user@hostname "sudo poweroff"
Shutdown computer at 00:00 every day.
- Cron set to
@daily
- Cmd set to
sshpass -p password1234 ssh -o "StrictHostKeyChecking=no" [email protected] "sudo poweroff"