26 lines
No EOL
535 B
Bash
Executable file
26 lines
No EOL
535 B
Bash
Executable file
#!/usr/bin/expect
|
|
|
|
set timeout 30
|
|
|
|
if { $env(password_env) eq "" } {
|
|
send_user "password_env is empty\n"
|
|
exit 1
|
|
}
|
|
log_user 0
|
|
cd ./cofffeemachineConfig
|
|
spawn git pull
|
|
expect {
|
|
"ikong@192.168.10.159's password:" {
|
|
send "$env(password_env)\n"
|
|
expect {
|
|
"Already up to date." {
|
|
log_user 1
|
|
send_user "Already up to date."
|
|
}
|
|
"remote:" {
|
|
log_user 1
|
|
send_user "Coffee recipe updated."
|
|
}
|
|
}
|
|
}
|
|
} |