X Tutup
#!/usr/bin/env expect # vim:ts=4:sts=4:sw=4:et # # Author: Hari Sekhon # Date: Fri Jun 17 15:12:17 2016 +0100 # # https://github.com/harisekhon/devops-python-tools # # License: see accompanying Hari Sekhon LICENSE file # # If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish # # https://www.linkedin.com/in/harisekhon # set force_conservative 0 ;# 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 } } set timeout -1 spawn java -jar jython-installer.jar match_max 100000 expect -exact "Please select your language \[E/g\] >>> " send -- "\r" expect -exact "Do you want to read the license agreement now ? \[y/N\] >>> " send -- "\r" expect -exact "Do you accept the license agreement ? \[Y/n\] >>> " send -- "\r" expect -exact "Please select the installation type \[ 1 /2/3/9\] >>> " send -- "2\r" expect -exact "Do you want to install additional parts ? \[y/N\] >>> " send -- "\r" expect -exact "Please enter the target directory >>> " send -- "/opt/jython-2.7.0\r" expect -exact "Unable to find directory /opt/jython-2.7.0, create it ? \[Y/n\] >>> " send -- "\r" expect -exact "Please confirm copying of files to directory /opt/jython-2.7.0 \[Y/n\] >>> " send -- "\r" expect -exact "Do you want to show the contents of README ? \[y/N\] >>> " send -- "\r" expect eof
X Tutup