Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automate installation of binary in linux

I have a Bourne-Again shell script text executable named engine.bin that I want to install.

If I install the executable manually ./engine.bin I get a screen with the EULA I have to accept (by pushing space), then accept it by writing yes and then enter the installation path by typing /usr/local/engine.

Now I want to do the installation automatically through provisioning scripts without manual interaction. Is there a way to do this? I do not know if the installer accepts any parameters, unfortunately the thing is undocumented.

like image 484
dArignac Avatar asked Dec 14 '25 03:12

dArignac


1 Answers

Based on the suggestion of bill-agee and jgr208 I wrote the following which is working for me:

#!/usr/bin/expect -f
set timeout -1
spawn /tmp/engine.bin
expect {
   -gl "*Press SPACE or PAGE DOWN key to continue, U or PAGE UP key to scroll back*" { send -- " "; exp_continue }
   -gl "*yes/no*"
}
send -- "yes\r" 
expect -gl "*press ENTER to accept the default*"
send -- "/tmp/tce\r"
expect eof
like image 98
dArignac Avatar answered Dec 16 '25 18:12

dArignac



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!