From 197a9c5708b5c6871cbbe12514ffea9996d7e887 Mon Sep 17 00:00:00 2001 From: encrypt Date: Wed, 25 Mar 2015 02:42:14 +0100 Subject: [PATCH] handle SIGINT --- etherswitch.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/etherswitch.sh b/etherswitch.sh index 519c4c3..cc62727 100755 --- a/etherswitch.sh +++ b/etherswitch.sh @@ -1,5 +1,6 @@ #!/bin/env bash +conf=~/.etherswitch switch_state=0 function check_fn { @@ -9,7 +10,10 @@ function check_fn { } } -source ~/.etherswitch +source $conf + +# handle SIGTERM +trap 'exit' 15 if [ -z "$device" ] then