README.txt DESCRIPTION: Apply or unapply a patch to remote Evergreen hosts USAGE: ./patch-eg.sh -p ID [ -b backup_label ] [ -P rule ] [ -y ] [ -R ] [ -h ] host1 host2... OPTIONS: -p SHA1 ID of patch to apply (mandatory) -b Backup label of patch Defaults to patch ID -P Patch rule (web, xul, perl) to determine patch directory, user, and strip level Defaults to 'web' -y Yes, apply the patch instead of doing a dry run -R Reverse or undo the patch instead of applying it -h Print this message and exit EXAMPLES: Use the script to apply and unapply a Perl patch on two of the production servers: 1. Perform a dry run to see what it will do # patch-eg.sh -p 1234567 -b rt12345 -P perl app1-1 app1-2 2. Rerun it using the -y option to actually apply the patch # patch-eg.sh -p 1234567 -b rt12345 -P perl -y app1-1 app1-2 3. To unapply the patch, run the script with the -R option as well # patch-eg.sh -p 1234567 -b rt12345 -P perl -y -R app1-1 app1-2 NOTES: The script logs in as 'sitkastaff' via SSH to each host, and then runs the patch command via sudo. Consequently, the script can ask for an account password many times. To avoid having to repeatedly type a password, run the script on the local server as 'sitkastaff' and have the account's public SSH key installed on the target servers. As a convenience, the above procedure has been done on 'sitkastaff@coconut', so that if the script is run on 'coconut' as 'sitkastaff', the script will only ask for a sudo password. Moreover, requiring a sudo password could be avoided if the PAM module PAM_SSH_AGENT_AUTH is installed and configured on target hosts. A limitation to the script is that it cannot easily apply a patch that mixes up changes to Perl files, XUL files, or Javascript files, because they would be installed on directories differently from their directories in the source directory. TO DO: 1. Handle duplicate hostnames specified on the command line. For example, # patch-eg.sh -p 1234567 app1-1 app1-1 would apply the patch to app1-1 once. 2. Perform filename expansion on hostnames. For example # patch-eg.sh -p 1234567 -P perl app[123]-[12] would apply the Perl patch to six servers, app1-1, app1-2, app2-1, app2-2, app3-1, app3-2. 3. Is it possible to get location of patch repository from git configuration?