mirror of
https://github.com/ansible/awx.git
synced 2026-02-01 01:28:09 -03:30
Merge branch 'release_2.3' into devel
* release_2.3: (54 commits) Upgrade changelog for 2.3 Purge superlance Purge an old supervisor config Require chris-lea libzmq3 Use the htpasswd command, not the module Fix a playbook syntax error for postgres Ensure postgres is started earlier in setup role Allow customizing npm path Include RPM-GPG-KEY-ansible-release for all releases Simplify GPG keys Correct broken RPM-GPG-KEY Use gpg --passphrase for signing CHECKSUM Handle rpm --addsign pasphrase prompts Adding docker-compose development workflow Fix license in spec file. Updates to selinux policy for some munin plugins ansible 1.8.4 requires sudo:true when using sudo_user Fix expect script timeout Disable timeout and correct sign.exp error Fix expect script hang ...
This commit is contained in:
49
tools/scripts/sign.exp
Executable file
49
tools/scripts/sign.exp
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/expect -f
|
||||
#
|
||||
# Helper script to respond to passphrase prompts from the gpg command.
|
||||
#
|
||||
|
||||
# Disable timeout
|
||||
set timeout -1
|
||||
|
||||
# Optionally print usage message
|
||||
if {[llength $argv] <= 0} {
|
||||
puts "Usage: sign.exp <command>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Process arguments
|
||||
set command [join $argv]
|
||||
|
||||
if { [info exists env(PASSPHRASE) ] } {
|
||||
set passphrase $env(PASSPHRASE)
|
||||
} else {
|
||||
set passphrase ""
|
||||
}
|
||||
|
||||
# Run the desired command
|
||||
spawn {*}$command
|
||||
expect {
|
||||
-nocase "enter passphrase:" {
|
||||
send -- "$passphrase\r"
|
||||
exp_continue
|
||||
}
|
||||
-nocase "enter pass phrase:" {
|
||||
send -- "$passphrase\r"
|
||||
exp_continue
|
||||
}
|
||||
timeout {
|
||||
puts "expect timeout"
|
||||
exit 1
|
||||
}
|
||||
eof { }
|
||||
}
|
||||
|
||||
lassign [wait] pid spawnid os_error_flag retval
|
||||
|
||||
if {$os_error_flag == 0} {
|
||||
puts "exit status: $retval"
|
||||
} else {
|
||||
puts "errno: $retval"
|
||||
}
|
||||
exit $retval
|
||||
Reference in New Issue
Block a user