update
This commit is contained in:
@@ -42,6 +42,33 @@ if ($type == "git_pull") {
|
||||
echo $output;
|
||||
}
|
||||
|
||||
if ($type == "set_RTC_withNTP") {
|
||||
$command = '/usr/bin/python3 /var/www/nebuleair_pro_4g/RTC/set_with_NTP.py';
|
||||
$output = shell_exec($command);
|
||||
echo $output;
|
||||
}
|
||||
|
||||
if ($type == "set_RTC_withBrowser") {
|
||||
$time = $_GET['time'];
|
||||
// Validate time format
|
||||
if (!strtotime($time)) {
|
||||
echo json_encode(['success' => false, 'message' => 'Invalid time format']);
|
||||
exit;
|
||||
}
|
||||
// Convert to RTC-compatible format (e.g., 'YYYY-MM-DD HH:MM:SS')
|
||||
$rtc_time = date('Y-m-d H:i:s', strtotime($time));
|
||||
|
||||
// Execute Python script to update the RTC
|
||||
$command = escapeshellcmd("/usr/bin/python3 /var/www/nebuleair_pro_4g/RTC/set_with_browserTime.py '$rtc_time'");
|
||||
$output = shell_exec($command);
|
||||
if ($output === null) {
|
||||
echo json_encode(['success' => false, 'message' => 'Failed to update RTC']);
|
||||
} else {
|
||||
echo json_encode(['success' => true, 'message' => 'RTC updated successfully']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($type == "clear_loopLogs") {
|
||||
$command = 'truncate -s 0 /var/www/nebuleair_pro_4g/logs/loop.log';
|
||||
$output = shell_exec($command);
|
||||
|
||||
Reference in New Issue
Block a user