?? config.pl
字號:
#!/usr/bin/perl -wif ( -e "/etc/gpage.conf" ){ $y_or_n = editing(); if ( $y_or_n eq "y" ) { create_file(); } else { print "\nHere is your current gpage.conf\n\n"; system("cat /etc/gpage.conf"); }}else{ create_file();}sub create_file{ print "\nCreating gpage.conf...\n"; print "Please read the README for any questions regarding the server confifuration\n\n"; open(WRITE_HANDLE, ">/etc/gpage.conf") || die "Unable to create /etc/gpage.conf\n"; print "Settings for the server: \n"; while ( 1 ) { print "Enter the domain or ip adress of the network workstation where the server will run: "; $domain = <STDIN>; chomp ($domain); if ( verify($domain) ) { print WRITE_HANDLE "server_domain=" . $domain . "\n"; last; } } while ( 1 ) { print "Enter the port you wish to use to talk to the g-page client (enter 1299 if you are unsure what port to use) "; $port = <STDIN>; chomp ($port); if ( verify($port) ) { print WRITE_HANDLE "port=" . $port . "\n"; last; } } while ( 1 ) { print "Enter the timeout value in seconds for connecting to a remote server: (60 - 120 are typical values): "; $timeout = <STDIN>; chomp ($timeout); if ( verify($timeout) ) { print WRITE_HANDLE "connect_timeout=" . $timeout . "\n"; last; } } while ( 1 ) { print "Enter the tiemout value for talking to a remote server:\nThis is the number of seconds gpage will wait for a response from a server, 60 - 120 serconds will work for most people: "; $r_timeout = <STDIN>; chomp ($r_timeout); if ( verify($r_timeout) ) { print WRITE_HANDLE "read_timeout=" . $r_timeout . "\n"; last; } } close(WRITE_HANDLE); print "\nConfiguration file has been written in /etc/gpage.conf\n"; system("cat /etc/gpage.conf"); }sub editing{ print "gpage.conf already exists - would you like to change your settings? (y/n) "; $in = <STDIN>; chomp ($in); return ($in);}sub verify{ print "You entered $_[0], is that correct? (y/n) "; $ok = <STDIN>; chomp ($ok); if ( $ok eq "y" ) { return ($returnv = 1); } else { return ($returnv = 0); }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -