#!/usr/bin/perl use strict; use CGI qw(:standard escapeHTML); # #decalare varialbes # my $line1= param('Line1'); my $line2= param('Line2'); my $MAC= param('MAC_Addr'); # #Print HTML to allow user to check their work # print header(), start_html, p (tt(escapeHTML($line1))),p (tt(escapeHTML($line2))),p (tt(escapeHTML +($MAC))); # #Open Text file and name it the MAC address based on user input, then +assign variables to provisioning fields in config file for ATA # open CONFIG, ">/usr/local/www/apache22/cgi-bin/data/$MAC.txt" or die $!; # #Line 1 provisioning information and formatting for config file. # print CONFIG 'Display_Name1 '; print CONFIG "\"$line1\"\;\n"; print CONFIG 'User_ID[1] '; print CONFIG "\"$line1\"\;\n"; print CONFIG 'Password[1] '; print CONFIG "\"$line1\"\;\n"; print CONFIG 'Use_Auth_ID[1] "Yes";'; print CONFIG "\n"; print CONFIG 'Auth_ID[1] '; print CONFIG "\"$line1\"\;\n"; # #Line 2 Provisioning information and formatting for config file. # print CONFIG 'Display_Name2 '; print CONFIG "\"$line2\"\;\n"; print CONFIG 'User_ID[2] '; print CONFIG "\"$line2\"\;\n"; print CONFIG 'Password[2] '; print CONFIG "\"$line2\"\;\n"; print CONFIG 'Use_Auth_ID[2] "Yes";'; print CONFIG "\n"; print CONFIG 'Auth_ID[2] '; print CONFIG "\"$line2\"\;\n"; # #close file for editing # close CONFIG; # #need to generate config file using Cisco's tool, which is stored in / +usr/sbin/ as spc.bin # system("/usr/sbin/spc.bin /usr/local/www/apache22/cgi-bin/data/$MAC.tx +t /usr/local/www/apache22/cgi-bin/data/$MAC.cfg"); pcystem("/usr/sbin/cp_conf.sh");
In reply to noob, need help by radriano
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |