Skip to content
Permalink
ac77935e89
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
0 contributors

Users who have contributed to this file

executable file 124 lines (119 sloc) 5.32 KB
#!/usr/bin/expect -f
#
# This Expect script was generated by autoexpect on Mon Apr 11 01:27:48 2016
# Expect and autoexpect were both written by Don Libes, NIST.
#
# Note that autoexpect does not guarantee a working script. It
# necessarily has to guess about certain things. Two reasons a script
# might fail are:
#
# 1) timing - A surprising number of programs (rn, ksh, zsh, telnet,
# etc.) and devices discard or ignore keystrokes that arrive "too
# quickly" after prompts. If you find your new script hanging up at
# one spot, try adding a short sleep just before the previous send.
# Setting "force_conservative" to 1 (see below) makes Expect do this
# automatically - pausing briefly before sending each character. This
# pacifies every program I know of. The -c flag makes the script do
# this in the first place. The -C flag allows you to define a
# character to toggle this mode off and on.
set force_conservative 1 ;# set to 1 to force conservative mode even if
;# script wasn't run conservatively originally
if {$force_conservative} {
set send_slow {1 .1}
proc send {ignore arg} {
sleep .1
exp_send -s -- $arg
}
}
#
# 2) differing output - Some programs produce different output each time
# they run. The "date" command is an obvious example. Another is
# ftp, if it produces throughput statistics at the end of a file
# transfer. If this causes a problem, delete these patterns or replace
# them with wildcards. An alternative is to use the -p flag (for
# "prompt") which makes Expect only look for the last line of output
# (i.e., the prompt). The -P flag allows you to define a character to
# toggle this mode off and on.
#
# Read the man page for more info.
#
# -Don
set timeout -1
spawn java -jar grouperInstaller.jar
match_max 100000
expect -exact ""
send -- "\r"
expect -exact " (enter: 'install', 'upgrade', 'patch', 'createPatch' or blank for the default) \[install\]: "
send -- "\r"
expect -exact "Enter in the Grouper install directory (note: better if no spaces or special chars) \[/home/grouper/2.3.0\]: "
send -- "\r\r"
#expect -re "Enter the default IP address for checking ports"
#send -- "\r"
expect -exact "Do you want to set gsh script to executable (t|f)? \[t\]: "
send -- "\r"
expect -exact "Do you want to run dos2unix on gsh.sh (t|f)? \[t\]: "
send -- "\r"
expect -exact "Do you want to use the default and included hsqldb database (t|f)? \[t\]: "
send -- "f\r"
expect -exact "Enter the database URL \[jdbc:hsqldb:hsql://localhost:9001/grouper\]: "
send -- "jdbc:mysql://172.17.0.2:3306/grouper"
send -- "\r"
expect -exact "Database user \[sa\]: "
send -- "grouper\r"
expect -exact "Database password (note, you aren't setting the pass here, you are using an existing pass, this will be echoed back) \[<blank>\]: "
send -- "changeme\r"
expect -exact "Would you like to install all patches (t|f)? \[t\]: "
send -- "\r"
expect -exact "Please stop these processes if they are running and press <enter> to continue..."
send -- "\r"
expect -exact "Do you want to init the database (delete all existing grouper tables, add new ones) (t|f)? "
send -- "t\r"
expect -exact "Do you want to add quickstart subjects to DB (t|f)? \[t\]: "
send -- "\r"
expect -exact "Do you want to add quickstart data to registry (t|f)? \[t\] "
send -- "\r"
expect -exact "Do you want to set the tomcat memory limit (t|f)? \[t\]: "
send -- "\r"
expect -exact "Do you want to set tomcat scripts to executable (t|f)? \[t\]: "
send -- "\r"
expect -exact "Do you want to run dos2unix on tomcat sh files (t|f)? \[t\]: "
send -- "\r"
expect -exact "What ports do you want tomcat to run on (HTTP, JK, shutdown): \[8080, 8009, 8005\]: "
send -- "\r"
expect -exact "Do you want to set URIEncoding to UTF-8 in tomcat server.xml <Connector> elements (t|f)? \[t\]: "
send -- "\r"
expect -exact "Should we stop tomcat anyway? (t|f)? \[f\] "
send -- "\r"
expect -exact "Do you want to set the log dir of UI (t|f)? \[t\]: "
send -- "\r"
expect -exact "Enter the UI log dir: \[/home/grouper/2.2.2/apache-tomcat-6.0.35/logs/grouperUi\]: "
send -- "\r"
expect -exact "Enter the URL path for the UI \[grouper\]: "
send -- "\r"
expect -exact "Enter the GrouperSystem password: "
send -- "changeme\r"
expect -exact "Do you want to set the GrouperSystem password in /home/grouper/2.2.2/apache-tomcat-6.0.35/conf/tomcat-users.xml? \[t\]: "
send -- "\r"
expect -exact "Should we stop tomcat anyway? (t|f)? \[f\] "
send -- "\r"
expect -exact "Should we check ports to see if tomcat was able to start (t|f)? \[t\]: "
send -- "\r"
expect -exact "The Grouper WS has been built in the past, do you want it rebuilt? (t|f) \[t\]: "
send -- "\r"
expect -exact "Should we check ports to see if tomcat was able to stop (t|f)? \[t\]: "
send -- "\r"
expect -exact "Do you want to set the log dir of WS (t|f)? \[t\]: "
send -- "\r"
expect -exact "Enter the WS log dir: \[/home/grouper/2.2.2/apache-tomcat-6.0.35/logs/grouperWs\]: "
send -- "\r"
expect -exact "Enter the URL path for the WS \[grouper-ws\]: "
send -- "\r"
expect -exact "Should we stop tomcat anyway? (t|f)? \[f\] "
send -- "\r"
expect -exact "Should we check ports to see if tomcat was able to start (t|f)? \[t\]: "
send -- "\r"
expect -exact "Do you want to install the provisioning service provider (t|f)? \[t\]: "
send -- "\r"
expect -exact " (note, if it is already running, you need to stop it now, check ps -ef | grep gsh | grep loader) (t|f)? \[f\]: "
send -- "\r"
expect eof