|
From: Ivan D. <idr...@us...> - 2006-06-14 01:23:30
|
Update of /cvsroot/terk/embed/www/cgi-bin In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv1919 Modified Files: wifiSave.cgi wiredSave.cgi Log Message: writing to config files bug fixed Index: wifiSave.cgi =================================================================== RCS file: /cvsroot/terk/embed/www/cgi-bin/wifiSave.cgi,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wifiSave.cgi 9 Jun 2006 20:24:21 -0000 1.1 --- wifiSave.cgi 14 Jun 2006 01:23:24 -0000 1.2 *************** *** 1,6 **** #!/opt/bin/microperl ! open (CONFIG, ">", "/opt/config.wlan0") or die "Cannot open config.wlan0... $!\n"; @values = split(/&/,$ENV{'QUERY_STRING'}); --- 1,18 ---- #!/opt/bin/microperl + $file = '/opt/config.wlan0'; # Config file + open (CONFIG, ">$file"); # Open for output ! $logfile = '/opt/connectlog0.txt'; # Log file ! open(LOG, ">>$logfile"); # Open for appending ! ! print LOG "wifiSave.cgi\n"; ! ! #open (CONFIG, ">", "/opt/config.wlan0") or die "Cannot open config.wlan0... $!\n"; ! ! foreach $env_var (split(/\n/, `/usr/bin/env`)) { ! $env_var =~ /([^=]+)=(.*)/; ! $ENV{$1} = $2; ! }; @values = split(/&/,$ENV{'QUERY_STRING'}); *************** *** 9,19 **** ($varname, $value) = split(/=/, $i); $data{$varname} = $value; ! print TEST "$varname = $value\n"; } if($data{isSSIDAuto} eq 'true'){ print CONFIG "auto=true\n"; } else { print CONFIG "auto=false\n"; } --- 21,33 ---- ($varname, $value) = split(/=/, $i); $data{$varname} = $value; ! print LOG "$varname = $value\n"; } if($data{isSSIDAuto} eq 'true'){ print CONFIG "auto=true\n"; + print LOG "auto=true\n"; } else { print CONFIG "auto=false\n"; + print LOG "auto=false\n"; } *************** *** 23,29 **** --- 37,49 ---- print CONFIG "networkKey=$data{networkKey}\n"; + print LOG "\tssid=$data{ssid}\n"; + print LOG "\tnetworkStructure=$data{networkStructure}\n"; + print LOG "\tdataEncryption=$data{dataEncryption}\n"; + print LOG "\tnetworkKey=$data{networkKey}\n"; + close CONFIG; print "Content-type: text/html\n\n"; + print "<script language=\"JavaScript\">; Index: wiredSave.cgi =================================================================== RCS file: /cvsroot/terk/embed/www/cgi-bin/wiredSave.cgi,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wiredSave.cgi 9 Jun 2006 20:24:21 -0000 1.1 --- wiredSave.cgi 14 Jun 2006 01:23:24 -0000 1.2 *************** *** 1,5 **** #!/opt/bin/microperl ! open CONFIG, ">", "/opt/config.eth0"; @values = split(/&/,$ENV{'QUERY_STRING'}); --- 1,16 ---- #!/opt/bin/microperl ! $file = '/opt/config.eth0'; # Config file ! open(CONFIG, ">$file"); # Open for output ! ! $logfile = '/opt/connectlog0.txt'; # Log file ! open(LOG, ">>$logfile"); # Open for appending ! ! print LOG "wiredSave.cgi\n"; ! ! foreach $env_var (split(/\n/, `/usr/bin/env`)) { ! $env_var =~ /([^=]+)=(.*)/; ! $ENV{$1} = $2; ! } @values = split(/&/,$ENV{'QUERY_STRING'}); *************** *** 11,14 **** --- 22,26 ---- print CONFIG "useDHCP=$data{isIPAuto}\n"; + print LOG "useDHCP=$data{isIPAuto}\n"; $IP = combineIP($data{IPaddress1}, $data{IPaddress2}, $data{IPaddress3}, $data{IPaddress4}); *************** *** 25,28 **** --- 37,48 ---- print CONFIG "secondaryDNS=$secondaryDNS\n"; + print LOG "\taddress=$IP\n"; + print LOG "\tmask=$mask\n"; + print LOG "\tgateway=$gateway\n"; + print LOG "\tisDNSAuto=$data{isDNSAuto}\n"; + print LOG "\tprimaryDNS=$primaryDNS\n"; + print LOG "\tsecondaryDNS=$secondaryDNS\n"; + + close CONFIG; |