Created
March 30, 2020 12:36
-
-
Save hplc/439b70419802f8e7a67b925fb2390f0c to your computer and use it in GitHub Desktop.
Monitor atd service and restart it if not running.
This file contains 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 characters
#!/usr/bin/php | |
<?php | |
$cmd = '/sbin/service atd'; | |
$atd = `$cmd status`; | |
// var_dump($atd); | |
if (! preg_match('/is running/', $atd)) | |
{ | |
$result = `$cmd start`; | |
echo $result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment