SHARE
TWEET

Untitled

a guest Mar 17th, 2018 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <owner> <question> <type> <value>
  2.    
  3. my-package username string Bob
  4. my-package password string I$aN1ceGuy
  5.    
  6. debconf-get-selections | grep my-package
  7.    
  8. debconf-set-selections <filename>.  
  9. dpkg -i my-package
  10.    
  11. apt-get install expect
  12.    
  13. #!/usr/bin/expect -f
  14. set timeout 30
  15. set password "pass"
  16. set username "user"
  17.  
  18. #run the command
  19. spawn dpkg -i package.deb
  20.  
  21. # Look for username prompt
  22. expect "*?sername:*" #<--- this statement is important it wait's for a prompt "username:"
  23. send "$usernamer"
  24.  
  25. # Look for passwod prompt
  26. expect "*?assword:*" #<--- the same with the "password:" prompt
  27. send "$passwordr"
  28.  
  29. #dpkg -i continues
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top