`/scripts/rpc.php:` --- ``` #9: if (isset($_REQUEST['action'])) # 10: { # 11: switch($_REQUEST['action']) # ... # ... # 181: case 'updatetime': # 182: { # 183: // do something, the put our response in the response field... # 184: $strDate = shell_exec("rdate -s {$_REQUEST['timeserver']} 2>&1"); # 185: # 186: // set the hardware clock. # 187: $strResult = shell_exec("/sbin/hwclock -w"); // Does no harm to call this even on failure... # 188: # 189: $strtheDate = shell_exec("date 2>&1"); # 190: # 191: echo "updatetime|{$strDate}|{$strtheDate}"; # 192: # 193: break; # 194: } # 195: # 196: case 'updatelocaltime': # 197: { # 198: // do something, the put our response in the response field... # 199: $strDate = shell_exec("date -s '{$_REQUEST['localtime']}' 2>&1"); # 200: # 201: // set the hardware clock # 202: $strResult = shell_exec("/sbin/hwclock -w"); // Does no harm to call this even on failure... # 203: # 204: $strtheDate = shell_exec("date 2>&1"); # 205: # 206: echo...
`/scripts/rpc.php:` --- ``` #9: if (isset($_REQUEST['action'])) # 10: { # 11: switch($_REQUEST['action']) # ... # ... # 181: case 'updatetime': # 182: { # 183: // do something, the put our response in the response field... # 184: $strDate = shell_exec("rdate -s {$_REQUEST['timeserver']} 2>&1"); # 185: # 186: // set the hardware clock. # 187: $strResult = shell_exec("/sbin/hwclock -w"); // Does no harm to call this even on failure... # 188: # 189: $strtheDate = shell_exec("date 2>&1"); # 190: # 191: echo "updatetime|{$strDate}|{$strtheDate}"; # 192: # 193: break; # 194: } # 195: # 196: case 'updatelocaltime': # 197: { # 198: // do something, the put our response in the response field... # 199: $strDate = shell_exec("date -s '{$_REQUEST['localtime']}' 2>&1"); # 200: # 201: // set the hardware clock # 202: $strResult = shell_exec("/sbin/hwclock -w"); // Does no harm to call this even on failure... # 203: # 204: $strtheDate = shell_exec("date 2>&1"); # 205: # 206: echo "updatelocaltime|{$strDate}|{$strtheDate}"; # 207: # 208: break; # 209: } ```