mirror of
https://github.com/mr-vercetti/homeserver.git
synced 2025-01-18 16:25:35 +01:00
Add crontab, modify mgmt script, temp VPN fix
This commit is contained in:
parent
24f4ec532f
commit
94994a678f
6
crontab
Normal file
6
crontab
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# SnapRAID
|
||||||
|
30 4 * * 0 python3 /opt/snapraid-runner/snapraid-runner.py --conf /etc/snapraid-runner.conf --ignore-deletethreshold
|
||||||
|
# LG TV renew dev mode (https://github.com/webosbrew/dev-manager-desktop)
|
||||||
|
0 * * * * /etc/tv-renew-devmode.sh >> /var/log/tv-renew-devmode.log 2>&1
|
||||||
|
# DNS issues fix with Torguard
|
||||||
|
0 5 * * * /apps/homeserver/docker/torguard-fix.sh
|
@ -1,27 +1,50 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ $# -ne 1 ]; then
|
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
echo "Please provide command to execute: 'up', 'stop' or 'restart'"
|
|
||||||
|
if [ $# -lt 1 ]; then
|
||||||
|
echo "Please provide command to execute: 'up', 'stop', 'restart', or 'recreate'"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
command="$1"
|
command="$1"
|
||||||
|
|
||||||
for stack in stacks/*/*
|
case "$command" in
|
||||||
do
|
|
||||||
case "$command" in
|
|
||||||
"up")
|
"up")
|
||||||
docker-compose -f "${stack}" --env-file .env up -d
|
for stack in "$BASE_DIR"/stacks/*/*
|
||||||
|
do
|
||||||
|
docker-compose -f "${stack}" --env-file "$BASE_DIR/.env" up -d
|
||||||
|
done
|
||||||
;;
|
;;
|
||||||
"stop")
|
"stop" | "restart")
|
||||||
docker-compose -f "${stack}" --env-file .env stop
|
for stack in "$BASE_DIR"/stacks/*/*
|
||||||
|
do
|
||||||
|
docker-compose -f "${stack}" --env-file "$BASE_DIR/.env" $command
|
||||||
|
done
|
||||||
;;
|
;;
|
||||||
"restart")
|
"recreate")
|
||||||
docker-compose -f "${stack}" --env-file .env restart
|
if [ $# -lt 3 ]; then
|
||||||
|
echo "Please provide both the stack name and the service to recreate"
|
||||||
|
echo "Usage: $0 recreate <stack_name> <service_name>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
stack_name="$2"
|
||||||
|
service="$3"
|
||||||
|
stack_file="$BASE_DIR/stacks/${stack_name}/${stack_name}.yml"
|
||||||
|
|
||||||
|
if [ ! -f "$stack_file" ]; then
|
||||||
|
echo "Stack file '$stack_file' does not exist"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker-compose -f "${stack_file}" --env-file "$BASE_DIR/.env" stop "$service"
|
||||||
|
docker-compose -f "${stack_file}" --env-file "$BASE_DIR/.env" rm -f "$service"
|
||||||
|
docker-compose -f "${stack_file}" --env-file "$BASE_DIR/.env" up -d "$service"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Wrong command. Please use 'up', 'stop' or 'restart'"
|
echo "Wrong command. Please use 'up', 'stop', 'restart', or 'recreate'"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
|
||||||
|
12
docker/torguard-fix.sh
Executable file
12
docker/torguard-fix.sh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
dir="/apps/homeserver/docker/appdata/gluetun/wireguard"
|
||||||
|
file="$dir/wg0.conf"
|
||||||
|
file_old="$dir/wg0.conf.old"
|
||||||
|
file_tmp="$dir/wg0.conf.tmp"
|
||||||
|
|
||||||
|
mv $file $file_tmp
|
||||||
|
mv $file_old $file
|
||||||
|
mv $file_tmp $file_old
|
||||||
|
|
||||||
|
bash /apps/homeserver/docker/mgmt.sh recreate media qbittorrentvpn
|
Loading…
Reference in New Issue
Block a user