Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#!/usr/bin/expect
set timeout -1
#exp_internal 1
log_file "/home/$env(USER)/su.log"
set rootprompt "root@[exec uname -n]:.*"
set pass ""
proc getHiddenIn {msg} {
puts -nonewline $msg
flush stdout
stty -echo
set ans [gets stdin]
stty echo
return ans
}
spawn -noecho su
expect {
-re "Passwor.+" {
send "[getHiddenIn]\r"
#or send "$pass\r"
expect {
-re "$rootprompt" {
send_user "\nRoot login successful..\n"
send "\n\r"
send_user "Type \"quit\" to leave\n"
interact {
"quit" {send_user "\n" ; exit}
}
}
}
-re "^(su:) .+" {
send_user "Bad password..\n"
exit
}
}
}