revert_patch.sh (414B)
1 #!/bin/sh 2 # 3 # revert_patch.sh - Reverts an enhancement patch 4 # 5 6 if [ "$#" -ne 1 ] 7 then 8 echo "Usage: $0 patch_file" 9 echo ' Reverts the changes made by an enhancement patch' 10 exit 1 11 fi 12 13 read -p "Do you wish to revert the patch '$1'? [Y/N] " response 14 case "$response" in 15 Y|y) 16 patch -p1 -R < "$1" 17 ;; 18 N|n) 19 echo 'Quit' 20 exit 1 21 ;; 22 *) 23 echo "Invalid response '$response'." 24 exit 1 25 ;; 26 esac 27 28