Sha256: 9988a6d3a70418b7db29bf5787f2d6768359b8006fb560e4bce1dbb7c64c40f0
Contents?: true
Size: 891 Bytes
Versions: 8
Compression:
Stored size: 891 Bytes
Contents
#!/usr/bin/expect -- set pass $env(GPG_PASSWORD) set badpass 0 set timeout 5 set count 5; eval spawn $argv # Apt asks for your passphrase twice, hence the loop while {$count > 0 } { expect { "phrase:" { send "$pass\r" } "Bad passphrase" { # CentOS/RHEL case set badpass 1 } "again:" { # Ubuntu case, it reprompts. Keep sending till it runs out of retries # else we'll corrupt the db when we exit easrly send "$pass\r" set badpass 1 } eof { if {$badpass == 1} { puts "Failure! Bad Passphrase!" exit 1 } else { puts "Success!" exit 0 } } timeout { puts "\nTimeout failure. For Apt, repo DB may be locked/corrupted and need to be refetch manually" exit 1 } } set count [expr $count-1]; } puts "Failed to sign package after 5 attempts" exit 1
Version data entries
8 entries across 8 versions & 1 rubygems