You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
<?php require_once('/srv/scripts/sys_utils.php');
unset( $SYS_CONFIG['NET_INFO'] ); unset( $SYS_CONFIG['NET_CONFIG'] ); $SYS_CONFIG['NET_CONFIG'] = get_network_config(); $SYS_CONFIG['PERIODIC_JOB_COUNTS'] = 0; $TD = get_SERVICE_STATUS( 'smbd' ); $SYS_CONFIG['SAMBA_IS_ON'] = $TD['ENA']; $SYS_CONFIG['ARGUS_CONFIG'] = get_argus_config(); if( !isset( $SYS_CONFIG['MODEM_SETUP'] ) ) $SYS_CONFIG['MODEM_SETUP'] = false; if( !$SYS_CONFIG['MODEM_SETUP'] ){ $MOMO = `mmcli -L`; $TAR = explode( "\n", $MOMO ); if( count( $TAR ) > 1 ){ $SYS_CONFIG['MODEM_CONFIG']['DEVICES'] = array(); foreach( $TAR as $T ) { $CMS = trim( $T ); if( $CMS!= '' ){ $PAPA = explode( ' ', $CMS ); $AMO = explode( '/', $PAPA[0] ); $MID = intval( $AMO[count($AMO)-1] ); $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']; $MANU['modem']['CONNECT_AT_BOOT'] = false; $MANU['modem']['CUSTOM_APN'] = ''; $MANU['modem']['CUSTOM_APN_USER'] = ''; $MANU['modem']['CUSTOM_APN_PASSWORD'] = ''; $SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$MID]=$MANU['modem']; $SYS_CONFIG['MODEM_SETUP'] = true; }; }; }; } else { foreach( $SYS_CONFIG['MODEM_CONFIG']['DEVICES'] as $MID=>$CD ){ if( isset( $CD['CONNECT_AT_BOOT'] )){ // Connect Modem
if( $CD['CONNECT_AT_BOOT'] ){ $SIMP_CON_STR = array(); if( $CD['CUSTOM_APN'] != '' ) $SIMP_CON_STR[] = "apn={$CD['CUSTOM_APN']}"; if( $CD['CUSTOM_APN_USER'] != '' ) $SIMP_CON_STR[] = "user={$CD['CUSTOM_APN_USER']}"; if( $CD['CUSTOM_APN_PASSWORD'] !='' ) $SIMP_CON_STR[] = "password={$CD['CUSTOM_APN_PASSWORD']}"; $SIMP_CS = implode( ',', $SIMP_CON_STR ); $CMD = "mmcli -m {$MID} --simple-connect=\"{$SIMP_CS}\""; $L = `$CMD`; }; }; //echo "Load Modem {$ID} NFO\n";
$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']; }; }; save_system_config();
?>
|