#!/usr/bin/expect -f # Get the inputs from command-line arguments set webui_password [lindex $argv 0] set user_id [lindex $argv 1] set user_password [lindex $argv 2] # Set the timeout set timeout -1 # Run the command spawn /home/retroshareuser/.local/bin/retroshare-service -s -P 0.0.0.0 -W -B /home/retroshareuser/webui -U $user_id # Send the Webui password when prompted expect "Please register a password for the web interface:" send "$webui_password\r" # Send the Webui password again when prompted expect "Please enter the same password again :" send "$webui_password\r" # Send the User password when prompted expect -re ".*<>\\(.*\\) :" send "$user_password\r" # Give control back to the user expect eof