2016-07-28 36 views

回答

0

#! /bin/bash 
while true; do 
    curl --fail --silent http://localhost/your.page >/dev/null 
    if [[ $? -eq 22 ]]; then 
     sudo reboot 
    fi 
    sleep 15 
done 

東西檢查curl man page更多細節

+0

我怎麼能編譯爲使其工作代碼? –

+0

這是bash。無需編譯 –

+0

非常感謝! –