kill program when error is trapped

This commit is contained in:
James Barnett
2017-05-30 06:49:59 -04:00
parent dfab7e88d0
commit be30b052a4

View File

@@ -46,7 +46,11 @@ die() {
exit 1 exit 1
} }
sigkill() { traperror() {
die "Exited due to error."
}
trapkill() {
die "Exited due to user intervention." die "Exited due to user intervention."
} }
@@ -73,8 +77,8 @@ Options:
EOF EOF
} }
trap error ERR trap traperror ERR
trap sigkill SIGTERM SIGINT trap trapkill SIGTERM SIGINT
ssh="" ssh=""
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do