a guest Mar 17th, 2018 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- <owner> <question> <type> <value>
- my-package username string Bob
- my-package password string I$aN1ceGuy
- debconf-get-selections | grep my-package
- debconf-set-selections <filename>.
- dpkg -i my-package
- apt-get install expect
- #!/usr/bin/expect -f
- set timeout 30
- set password "pass"
- set username "user"
- #run the command
- spawn dpkg -i package.deb
- # Look for username prompt
- expect "*?sername:*" #<--- this statement is important it wait's for a prompt "username:"
- send "$usernamer"
- # Look for passwod prompt
- expect "*?assword:*" #<--- the same with the "password:" prompt
- send "$passwordr"
- #dpkg -i continues
RAW Paste Data