Last active
February 21, 2024 11:39
-
-
Save jrivero/741977 to your computer and use it in GitHub Desktop.
Control repeat of daemon
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 characters
<?php | |
function control_daemon_repeat() { | |
$ps = "/bin/ps aux | /bin/grep -i ".$_SERVER["argv"][0]." | /bin/grep -v grep | wc -l"; | |
$exec = exec($ps, $output, $return); | |
if ($output[0] > 1) die("*** Ya esta en ejecucion\n"); | |
} | |
// Example | |
control_daemon_repeat(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment