0
如何在觸發關機時執行功能?關機前執行功能
// need to make sure here that poweroff command is executed successfully before calling senEmail function
$output = exec('poweroff', $output, $return);
if (!$return) {
// command executed successfully
// now send email before poweroff completes its process
sendEmail();
}
sendEmail()
因爲關機已經處理,所以沒有觸發。
你不能。您可以在執行poweroff命令之前發送郵件。 –
@ Karthikeyan.R.S,哦!這是如此可悲的人。有沒有其他方法? – Defyleiti