#!/usr/bin/expect -f set timeout 3 set PACKAGE [lindex $argv 0] set GPG_PASSPHRASE $env(GPG_PASSPHRASE) if {[llength $argv] == 0} { send_user "Usage: ./sign \n" exit 1 } send_user "\nSigning $PACKAGE\n" spawn rpmsign --resign $PACKAGE expect { timeout { send_user "\nTimeout signing $PACKAGE\n"; exit 1 } "Enter pass phrase:" } send "$GPG_PASSPHRASE\r" expect { timeout { send_user "\nTimeout signing $PACKAGE\n"; exit 1 } "Pass phrase is good." } interact sleep 3