From 16d863e504363eced7682c3f32686e0cb5d2cffd Mon Sep 17 00:00:00 2001 From: Anri Kennel Date: Sat, 23 Dec 2023 20:37:19 +0100 Subject: [PATCH] Actualiser server --- server.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/server.md b/server.md index 6ece0b5..ae409a4 100644 --- a/server.md +++ b/server.md @@ -1,5 +1,10 @@ -only reboot if rsync isnt working +only reboot if vpn isn't used ```bash -if [[ $(ps ax | grep rsync | grep | wc -l) -lt 2 ]]; then shutdown --reboot now; fi +if [ $(ifstat -i tun0 1s 1 | awk 'NR==3 {print $1}' | sed 's#\..*##') -eq 0 ]; then systemctl reboot; fi +``` + +fix routing +> replace `` by the IP +```bash +if [ $(ip route | grep | wc -l) -ne 1 ]; then /root/openvpn/routing.sh; fi ``` -* penser à remplacer `` \ No newline at end of file