add git pull worker

This commit is contained in:
Kenta420 2023-10-30 10:45:33 +07:00
parent 70cfd89fc4
commit 15e74d47e3
5 changed files with 71 additions and 37 deletions

26
server/git_pull.sh Executable file
View 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."
}
}
}
}