12 changed files with 429 additions and 19 deletions
-
175lib/scripts/distro_web_utils.php
-
2lib/scripts/sys_utils.php
-
45lib/sysroot/srv/etc/boot.php
-
26lib/sysroot/srv/etc/cron.php
-
12lib/sysroot/srv/etc/pereodical.php
-
2lib/sysroot/srv/etc/system.json
-
35style/style.css
-
2task_wait.php
-
14wan_cp.php
-
22wan_location_cp.php
-
98wan_modem_operation.php
-
15wan_sms_cp.php
@ -1,11 +1,13 @@ |
|||
<?php |
|||
require_once( '/srv/scripts/sys_utils.php' ); |
|||
$SYS_CONFIG['PERIODIC_JOB_COUNTS']++; |
|||
if( $SYS_CONFIG['WIFI_MODE'] == 1 ){ |
|||
if( $SYS_CONFIG['PERIODIC_JOB_COUNTS'] == 5 ){ |
|||
$L=`/srv/scripts/wifi_ap_off.sh`; |
|||
$SYS_CONFIG['WIFI_IS_ON'] = false; |
|||
if( isset( $SYS_CONFIG['WIFI_MODE'] ) ){ |
|||
if( $SYS_CONFIG['WIFI_MODE'] == 1 ){ |
|||
if( $SYS_CONFIG['PERIODIC_JOB_COUNTS'] == 5 ){ |
|||
$L=`/srv/scripts/wifi_ap_off.sh`; |
|||
$SYS_CONFIG['WIFI_IS_ON'] = false; |
|||
save_system_config(); |
|||
}; |
|||
}; |
|||
}; |
|||
save_system_config(); |
|||
?>
|
|||
@ -1 +1 @@ |
|||
{"SAMBA_IS_ON":true,"ARGUS_CONFIG":{"app_is_running":true,"webui_is_running":true},"PERIODIC_JOB_COUNTS":0,"NET_CONFIG":{"lo":{"flags":{"hotplug":0,"auto":1},"net":[],"fam":"inet","mode":"loopback"},"enp6s0":{"flags":{"hotplug":1,"auto":0},"net":[],"fam":"inet","mode":"dhcp"}}} |
|||
{"PERIODIC_JOB_COUNTS":0,"SAMBA_IS_ON":true,"ARGUS_CONFIG":{"app_is_running":true,"webui_is_running":true},"MODEM_SETUP":true,"MODEM_CONFIG":{"DEVICES":[{"3gpp":{"enabled-locks":[],"eps":{"initial-bearer":{"dbus-path":"--","settings":{"apn":"--","ip-type":"--","password":"--","user":"--"}},"ue-mode-operation":"csps-1"},"imei":"860147051348496","operator-code":"42501","operator-name":"Partner","pco":"--","registration-state":"--"},"cdma":{"activation-state":"--","cdma1x-registration-state":"--","esn":"--","evdo-registration-state":"--","meid":"--","nid":"--","sid":"--"},"dbus-path":"\/org\/freedesktop\/ModemManager1\/Modem\/0","generic":{"access-technologies":["lte"],"bearers":[],"carrier-configuration":"ROW_Gen_VoLTE","carrier-configuration-revision":"05010822","current-bands":["egsm","dcs","utran-1","utran-5","utran-8","eutran-1","eutran-3","eutran-5","eutran-7","eutran-8","eutran-20","eutran-38","eutran-40","eutran-41"],"current-capabilities":["gsm-umts, lte"],"current-modes":"allowed: 2g, 3g, 4g; preferred: 4g","device":"\/sys\/devices\/pci0000:00\/0000:00:14.0\/usb1\/1-2","device-identifier":"370583bd437ad3b0629ff381ca0c81fc37647d4a","drivers":["option1","qmi_wwan"],"equipment-identifier":"860147051348496","hardware-revision":"10000","manufacturer":"QUALCOMM INCORPORATED","model":"SIMCOM_SIM7600E-H","own-numbers":[],"plugin":"simtech","ports":["cdc-wdm0 (qmi)","ttyUSB1 (qcdm)","ttyUSB2 (gps)","ttyUSB3 (at)","ttyUSB4 (at)","ttyUSB5 (audio)","wwan0 (net)"],"power-state":"on","primary-port":"cdc-wdm0","revision":"LE20B04SIM7600M22_210318","signal-quality":{"recent":"yes","value":"59"},"sim":"\/org\/freedesktop\/ModemManager1\/SIM\/0","state":"enabled","state-failed-reason":"--","supported-bands":["egsm","dcs","utran-1","utran-5","utran-8","eutran-1","eutran-3","eutran-5","eutran-7","eutran-8","eutran-20","eutran-38","eutran-40","eutran-41"],"supported-capabilities":["gsm-umts, lte"],"supported-ip-families":["ipv4","ipv6","ipv4v6"],"supported-modes":["allowed: 2g; preferred: none","allowed: 3g; preferred: none","allowed: 4g; preferred: none","allowed: 2g, 3g; preferred: 3g","allowed: 2g, 3g; preferred: 2g","allowed: 2g, 4g; preferred: 4g","allowed: 2g, 4g; preferred: 2g","allowed: 3g, 4g; preferred: 4g","allowed: 3g, 4g; preferred: 3g","allowed: 2g, 3g, 4g; preferred: 4g","allowed: 2g, 3g, 4g; preferred: 3g","allowed: 2g, 3g, 4g; preferred: 2g"],"unlock-required":"sim-pin2","unlock-retries":["sim-pin (3)","sim-puk (10)","sim-pin2 (3)","sim-puk2 (10)"]}}]},"NET_CONFIG":{"lo":{"flags":{"hotplug":0,"auto":1},"net":[],"fam":"inet","mode":"loopback"},"enp6s0":{"flags":{"hotplug":1,"auto":0},"net":[],"fam":"inet","mode":"dhcp"}}} |
|||
@ -0,0 +1,22 @@ |
|||
<?php |
|||
if( isset( $_GET['MID'] ) ){ |
|||
$MID = intval( $_GET['MID'] ); |
|||
require_once('../../scripts/sys_utils.php'); |
|||
require_once('../../scripts/distro_web_utils.php'); |
|||
|
|||
$MANU = json_decode( `mmcli -m $MID --output-json`, true ); |
|||
$LOLO = json_decode( `mmcli -m $MID --location-status --output-json`, true ); |
|||
$MANU['modem']['location'] = $LOLO['modem']['location']; |
|||
$SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$MID]=$MANU['modem']; |
|||
print_PAGE_HEADER(); |
|||
if( !isset( $SYS_CONFIG['NGINX_AUTH_IS_SET'] ) ){ |
|||
print_AUTH_WARNING(); |
|||
} elseif( $SYS_CONFIG['NGINX_AUTH_IS_SET'] == false ) { |
|||
print_AUTH_WARNING(); |
|||
}; |
|||
print_MODEM_LOCATION_INFO( $MID ); |
|||
print_PAGE_BOTTOM(); |
|||
} else { |
|||
header( 'location: /wan_cp.php' );//mmcli -m 0 --messaging-create-sms=“text=‘Hello world’,number=’+1234567890’”
|
|||
}; |
|||
?>
|
|||
@ -0,0 +1,98 @@ |
|||
<?php |
|||
if( isset( $_GET['MID'] ) || isset( $_POST['MID'] ) ){ |
|||
$COP = 0; |
|||
if( isset( $_GET['MID'] ) ){ |
|||
$MID = intval( $_GET['MID'] ); |
|||
} else { |
|||
$MID = intval( $_POST['MID'] ); |
|||
}; |
|||
if( isset( $_GET['OP'] ) ){ |
|||
$COP = intval( $_GET['OP'] ); |
|||
} elseif( isset( $_POST['OP'] ) ){ |
|||
$COP = intval( $_POST['OP'] ); |
|||
}; |
|||
if( $COP ){ |
|||
switch( $COP ){ |
|||
case 1:{ |
|||
//Enable Modem
|
|||
$CMD = "echo \"terrarium\" | sudo -S mmcli -m {$MID} --enable"; |
|||
$LL = `$CMD`; |
|||
require_once('../../scripts/sys_utils.php'); |
|||
$MANU = json_decode( `mmcli -m $MID --output-json`, true ); |
|||
$SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$MID]=$MANU['modem']; |
|||
save_system_config(); |
|||
header( 'location: /wan_cp.php' ); |
|||
break; |
|||
}; |
|||
case 2:{ |
|||
//Disable Modem
|
|||
$CMD = "echo \"terrarium\" | sudo -S mmcli -m {$MID} --disable"; |
|||
$LL = `$CMD`; |
|||
require_once('../../scripts/sys_utils.php'); |
|||
$MANU = json_decode( `mmcli -m $MID --output-json`, true ); |
|||
$SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$MID]=$MANU['modem']; |
|||
save_system_config(); |
|||
header( 'location: /wan_cp.php' ); |
|||
break; |
|||
}; |
|||
case 3:{ |
|||
//Enable Location Engine
|
|||
$ENG = ''; |
|||
switch( $_GET['PARAM'] ){ |
|||
case '3gpp-lac-ci': $ENG = '3gpp'; break; |
|||
case 'gps-raw': $ENG = 'gps-raw'; break; |
|||
case 'gps-unmanaged': $ENG = 'gps'; break; |
|||
case 'gps-nmea': $ENG = 'gps-nmea'; break; |
|||
case 'agps-msa': $ENG = 'agps-msa'; break; |
|||
case 'agps-msb': $ENG = 'agps-msb'; break; |
|||
}; |
|||
if( $ENG != '' ){ |
|||
$CMD = "echo \"terrarium\" | sudo -S mmcli -m {$MID} --location-enable-{$ENG}"; |
|||
$LL = `$CMD`; |
|||
require_once('../../scripts/sys_utils.php'); |
|||
$MANU = json_decode( `mmcli -m $MID -J`, true ); |
|||
$SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$MID]=$MANU['modem']; |
|||
save_system_config(); |
|||
}; |
|||
header( 'location: /wan_location_cp.php?MID='.$MID ); |
|||
break; |
|||
}; |
|||
case 4:{ |
|||
//Disable Location Engine
|
|||
$ENG = ''; |
|||
switch( $_GET['PARAM'] ){ |
|||
case '3gpp-lac-ci': $ENG = '3gpp'; break; |
|||
case 'gps-raw': $ENG = 'gps-raw'; break; |
|||
case 'gps-unmanaged': $ENG = 'gps'; break; |
|||
case 'gps-nmea': $ENG = 'gps-nmea'; break; |
|||
case 'agps-msa': $ENG = 'agps-msa'; break; |
|||
case 'agps-msb': $ENG = 'agps-msb'; break; |
|||
}; |
|||
if( $ENG != '' ){ |
|||
$CMD = "echo \"terrarium\" | sudo -S mmcli -m {$MID} --location-disable-{$ENG}"; |
|||
$LL = `$CMD`; |
|||
require_once('../../scripts/sys_utils.php'); |
|||
$MANU = json_decode( `mmcli -m $MID -J`, true ); |
|||
$SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$MID]=$MANU['modem']; |
|||
save_system_config(); |
|||
}; |
|||
header( 'location: /wan_location_cp.php?MID='.$MID ); |
|||
break; |
|||
}; |
|||
case 5:{ |
|||
//Create SMS
|
|||
header( 'location: /wan_location_cp.php?MID='.$MID ); |
|||
break; |
|||
}; |
|||
case 6:{ |
|||
// Delete SMS
|
|||
header( 'location: /wan_location_cp.php?MID='.$MID ); |
|||
break; |
|||
}; |
|||
}; |
|||
} else { |
|||
}; |
|||
} else { |
|||
header( 'location: /wan_cp.php' ); |
|||
}; |
|||
?>
|
|||
@ -0,0 +1,15 @@ |
|||
<?php |
|||
if( isset( $_GET['MID'] ) ){ |
|||
require_once('../../scripts/sys_utils.php'); |
|||
require_once('../../scripts/distro_web_utils.php'); |
|||
|
|||
print_PAGE_HEADER(); |
|||
if( $SYS_CONFIG['NGINX_AUTH_IS_SET'] == false ) { |
|||
print_AUTH_WARNING(); |
|||
}; |
|||
print_MODEM_SMS_LIST( 0 ); |
|||
print_PAGE_BOTTOM(); |
|||
} else { |
|||
header( 'location: /wan_cp.php' ); |
|||
}; |
|||
?>
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue