reset_test 437 Bytes
Newer Older
German Leon's avatar
sigo...  
German Leon committed
1
2
3
4
#!/bin/bash
function reset 
{
$comando
German Leon's avatar
German Leon committed
5
killall iamalive_ini; echo "Enable watchdog";echo -e "yanoesubuntu\n"|sudo -S shutdown -r now
German Leon's avatar
sigo...  
German Leon committed
6
7
8
9
}
trap 'reset' INT
 
function downcounter {
German Leon's avatar
German Leon committed
10
11
echo -e "yanoesubuntu\n"| sudo -S killall -9 test.sh 
echo -e "yanoesubuntu\n"| sudo -S killall -2 test.py &
German Leon's avatar
sigo...  
German Leon committed
12
13
14
15
16
17
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