Please try to fill out this form completely the first time, as you cannot currently come
back and make changes here later. If you need to make subsequent edits, see
/home/pi/localize.sh for a list of files you can tweak manually. You can
always reflash your SD card and start over if not sure.
Restarting device.
";
$IP = $_SERVER['SERVER_ADDR'];
echo "DigiPi will be available at
http://$IP/ in approximately one minute.
";
$output = shell_exec("sudo /sbin/shutdown -r 0");
echo $output;
}
}
if (isset($_POST["submit"])) {
if (strlen($_POST["call"]) > 0) {
$call = addslashes($_POST["call"]);
$output = shell_exec("sudo sed -i 's/NEWCALL=.*/NEWCALL=$call/gi' /home/pi/localize.sh ");
}
if (strlen($_POST["wlpass"]) > 0) {
$wlpass = addslashes($_POST["wlpass"]);
$output = shell_exec("sudo sed -i 's/NEWWLPASS=.*/NEWWLPASS=$wlpass/gi' /home/pi/localize.sh ");
}
if (strlen($_POST["aprspass"]) > 0) {
$aprspass = addslashes($_POST["aprspass"]);
$output = shell_exec("sudo sed -i 's/NEWAPRSPASS=.*/NEWAPRSPASS=$aprspass/gi' /home/pi/localize.sh ");
}
if (strlen($_POST["grid"]) > 0) {
$grid = addslashes($_POST["grid"]);
$output = shell_exec("sudo sed -i 's/NEWGRID=.*/NEWGRID=$grid/gi' /home/pi/localize.sh");
}
if (strlen($_POST["lat"]) > 0) {
$lat = addslashes($_POST["lat"]);
$output = shell_exec("sudo sed -i 's/NEWLAT=.*/NEWLAT=$lat/gi' /home/pi/localize.sh ");
}
if (strlen($_POST["lon"]) > 0) {
$lon = addslashes($_POST["lon"]);
$output = shell_exec("sudo sed -i 's/NEWLON=.*/NEWLON=$lon/gi' /home/pi/localize.sh ");
}
if (strlen($_POST["nodepass"]) > 0) {
$nodepass = addslashes($_POST["nodepass"]);
$output = shell_exec("sudo sed -i 's/NEWNODEPASS=.*/NEWNODEPASS=$nodepass/gi' /home/pi/localize.sh ");
}
if (strlen($_POST["rignumber"]) > 0) {
$rignumber = addslashes($_POST["rignumber"]);
$output = shell_exec("sudo sed -i 's/NEWRIGNUMBER=.*/NEWRIGNUMBER=$rignumber/gi' /home/pi/localize.sh ");
}
if (strlen($_POST["devicefile"]) > 0) {
$devicefile = addslashes($_POST["devicefile"]);
$output = shell_exec("sudo sed -i 's/NEWDEVICEFILE=.*/NEWDEVICEFILE=$devicefile/gi' /home/pi/localize.sh ");
}
if (strlen($_POST["baudrate"]) > 0) {
$baudrate = addslashes($_POST["baudrate"]);
$output = shell_exec("sudo sed -i 's/NEWBAUDRATE=.*/NEWBAUDRATE=$baudrate/gi' /home/pi/localize.sh ");
}
if (isset($_POST["flrig"])) {
$output = shell_exec("sudo sed -i 's/NEWFLRIG=.*/NEWFLRIG=1/gi' /home/pi/localize.sh ");
}
if (isset($_POST["bigvnc"])) {
$output = shell_exec("sudo sed -i 's/NEWBIGVNC=.*/NEWBIGVNC=1/gi' /home/pi/localize.sh ");
}
echo 'Changes applied. ';
echo'
';
echo "
";
echo "
";
echo "
";
$output = shell_exec('head -17 /home/pi/localize.sh | tail -13 ');
$output = shell_exec('sudo /home/pi/localize.sh');
}
?>