????
Current Path : /scripts/ |
Current File : //scripts/expectcpanm |
#!/usr/bin/expect -- #strace 5 eval spawn /usr/local/cpanel/bin/cpanm --notest $argv set question "\\?.*\\\[" set questions "\\\[.*\\\] " set timeout 180 while {1} { expect { "*perlmod--Install done*" { exit 0 } eof { catch wait reason exit [lindex $reason 3] } "*Apache source not found*" { send "q\r" } "*Which SSL install path do you want to use*" { send "/usr\r" } "*SSLeay is no longer supported*" { send "/usr\r" } "*Which OpenSSL build path*" { send "/usr\r" } "*path name or q to quit*" { send "q\r" } "*run external tests*" { send "no\r" } "*Shall I follow them and prepend them to the queue*" { send "y\r" } "*run the tests anyway*" { send "no\r" } "*update your config*" { send "no\r" } "*mod_perl*\\?*" { send "n\r" } "*your continent*" { send "6\r" } "*elect your country*" { send "4\r" } "*Press return to continue*" { send "\r" } "*Press enter to continue*" { send "\r" } "*nter library directory to use*" { send "\r" } "*nter include directory to use*" { send "\r" } "*Build JPEG support*" { if {[file exists "/usr/lib/libjpeg.a"] || [file exists "/usr/lib64/libjpeg.a"] || [file exists "/usr/local/lib/libjpeg.a"]} { send "y\r" } else { send "n\r" } } "*please give the full path to an httpd*" { send "!\r" } "*where I can find your apache src*" { send "q\r" } "*Build XPM support*" { if {[file exists "/usr/X11R6/lib/libXpm.a"] || [file exists "/usr/X11R6/lib64/libXpm.a"]} { send "y\r" } else { send "n\r" } } "*_proxy\?*" { send "\r" } "*Build FreeType support*" { if {[file exists "/usr/lib/libttf.so"] || [file exists "/usr/local/lib/libttf.so"] || [file exists "/usr/lib64/libttf.so"]} { send "n\r" } else { send "n\r" } } "*XALAN base directory*" { send ".\r" } "*add the remove instructions*" { send "no\r" } "*put them on one line*" { send "11\r" } "*manual configuration*" { send "no\r" } "*do you want to use*" { send "y\r" } "*choice:*" { send "\r" } -re $question { send "\r" } -re $questions { send "\r" } timeout {send "\r"; exp_continue} default {} } } catch wait reason exit [lindex $reason 3]