Last aku teringat Jimin cerita dia buat VPN pakai SSH. Aku pun try. Alhamdulillah jadik.
Script akan sentiasa looping.
Koronologinya :
- Start loop
- Ada satu script yang sentiasa monitor file command
- kalau file tu ada, dia exec
- sleep 2 saat
- delete file tersebut lepas dia execute
- kalau x de file tu, sleep 2 saat
- Loop lagi
- Tammat.
#!/bin/sh
while [ 1 -ne 2 ]
do
if [ -f /opt/lampp/htdocs/ipvision-client/cmd.sh ]; then
/bin/chmod 777 /opt/lampp/htdocs/ipvision-client/cmd.sh
/bin/sh /opt/lampp/htdocs/ipvision-client/cmd.sh
sleep 2
/bin/rm /opt/lampp/htdocs/ipvision-client/cmd.sh
fi
sleep 2
done
p/s : boleh pendekkan lagi script ni.
0 comments:
Post a Comment