Created
March 24, 2021 08:29
-
-
Save ibnux/e0f4a6411bcc5dfae1aef13ae9898b8c to your computer and use it in GitHub Desktop.
Revisions
-
ibnux revised this gist
Mar 24, 2021 . No changes.There are no files selected for viewing
-
ibnux created this gist
Mar 24, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ <?php /** * Simpan di folder project go whatsapp rest * disebelah Dockerfile * jalankan cronjob setiap 5 menit * cronjob: */5 * * * * cd /path/to/go-whatsapp-rest && php check.php */ $file = "./config/085156812578.gob"; $path = "./config/stores/085156812578.gob"; $bot_telegram = ''; $chat_id = '1234567'; if(!file_exists($path)){ copy($file,$path); echo "sudah dicopy \n"; if(!empty($bot_telegram)){ file_get_contents('https://api.telegram.org/bot'.$bot_telegram.'/sendMessage?chat_id='.$chat_id.'&text='.urlencode("Wa dicopy lagi")); } }else{ $md5a = md5_file($file); $md5b = md5_file($path); if($md5a!=$md5b){ unlink($file); copy($path,$file); echo "update file\n"; if(!empty($bot_telegram)){ file_get_contents('https://api.telegram.org/bot'.$bot_telegram.'/sendMessage?chat_id='.$chat_id.'&text='.urlencode("Session Wa baru dicopy lagi")); } }else echo "masih ada \n"; }