reset_test 348 Bytes
Newer Older
German Leon's avatar
sigo...  
German Leon committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
function reset 
{
$comando
killall iamalive_ini; echo "Enable watchdog";sudo shutdown -r now
}
trap 'reset' INT
 
function downcounter {
sudo killall -9 test.sh
sudo killall -2 test.py
for i in $(seq 3 -1 1); do  echo -en "Cuenta atras para shutdown $i \r"; sleep 1; done
}

comando=$1
pgrep -x test.py > /dev/null && downcounter
reset