2023-04-26 09:23:56 +02:00
|
|
|
#!/usr/bin/env bash
|
2020-02-23 04:02:24 +01:00
|
|
|
|
2023-04-26 09:23:56 +02:00
|
|
|
function stop_program() {
|
|
|
|
echo "stop $1"
|
|
|
|
sudo systemctl stop "$1"
|
2020-02-23 04:02:24 +01:00
|
|
|
}
|
|
|
|
|
2023-04-26 09:23:56 +02:00
|
|
|
function start_program() {
|
|
|
|
echo "start $1"
|
|
|
|
sudo systemctl stop "$1"
|
2020-02-23 04:02:24 +01:00
|
|
|
}
|
|
|
|
|
2023-04-26 09:23:56 +02:00
|
|
|
function start() {
|
|
|
|
echo "starting programs again"
|
|
|
|
echo "-----------------------"
|
|
|
|
echo
|
|
|
|
start_program backup.on-porani.insecure.timer
|
|
|
|
start_program backup.on-workhorse.insecure.timer
|
|
|
|
start_program backup.on-workout.insecure.timer
|
|
|
|
start_program syncthing.service
|
|
|
|
start_program tlp.service
|
|
|
|
start_program tor.service
|
2020-02-23 04:02:24 +01:00
|
|
|
}
|
|
|
|
|
2023-04-26 09:23:56 +02:00
|
|
|
function stop() {
|
|
|
|
echo "stopping programs"
|
|
|
|
echo "-----------------"
|
|
|
|
echo
|
|
|
|
stop_program backup.on-porani.insecure.timer
|
|
|
|
stop_program backup.on-workhorse.insecure.timer
|
|
|
|
stop_program backup.on-workout.insecure.timer
|
|
|
|
stop_program syncthing.service
|
|
|
|
stop_program tlp.service
|
|
|
|
stop_program tor.service
|
2020-02-23 04:02:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# ----
|
|
|
|
# main
|
|
|
|
# ----
|
|
|
|
|
|
|
|
stop
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo -n "wait to start again -> "
|
2023-04-26 09:23:56 +02:00
|
|
|
read -r
|
2020-02-23 04:02:24 +01:00
|
|
|
echo
|
|
|
|
|
|
|
|
start
|