add git pull worker
This commit is contained in:
parent
70cfd89fc4
commit
15e74d47e3
5 changed files with 71 additions and 37 deletions
26
server/git_pull.sh
Executable file
26
server/git_pull.sh
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/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."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue