Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4049

Other programming languages • Re: How to create at jobs from a website interface?

$
0
0
Here's something that might help you get started

Code:

<?php$at_time = "00:18";$at_cmd = "touch /tmp/flagfile";$at = popen("at " . $at_time, "w");fprintf($at, "%s", $at_cmd);pclose($at);?>
Hmm, I don't really understand what this does and how it ties into a webserver...
For instance, what does this do (after I tried expand the above):

Code:

$at = popen("at " . $at_time, "w"); //Open some file or what??fprintf($at, "%s", "touch /tmp/flagfile");  //Touching a temp file, why???pclose($at); //Close the opened file?
What I had in mind was to send the at command parameters from a webform post into a php script which would compose the command to activate the at setting. The problem might be how to do this as the non-sudo user, I guess...
Alternatively if I could write a command file from the web script, then perhaps this could be read by a daemon I set up which would issue the at command as my user when it finds it?

Statistics: Posted by Bosse_B — Sun Feb 11, 2024 1:29 pm



Viewing all articles
Browse latest Browse all 4049

Trending Articles