summaryrefslogtreecommitdiff
path: root/setnet.dash
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2017-01-02 13:26:12 +0000
committerKatolaZ <katolaz@freaknet.org>2017-01-02 13:26:12 +0000
commitebd8c26588b5aefa949e595ffd877ef3a836a98d (patch)
treeb5ec3bbdc453e1a3c838870f877f20c298675f85 /setnet.dash
parentd5c2f3a98b2fb03ff176ff95fc73aa3cef801999 (diff)
solved a little bug in trap (now working properly in all the supported shells)
Diffstat (limited to 'setnet.dash')
-rwxr-xr-xsetnet.dash14
1 files changed, 8 insertions, 6 deletions
diff --git a/setnet.dash b/setnet.dash
index e6d804a..5258b1b 100755
--- a/setnet.dash
+++ b/setnet.dash
@@ -35,8 +35,6 @@ TOPSTR="setnet-0.1 [user: $(id -run)]"
DIALOG="dialog --backtitle \"${TOPSTR}\" "
-TMPFILE=$( (tempfile) 2>/dev/null) || TMPFILE=/tmp/setnet_$$
-WPA_PIDFILE=$( (tempfile) 2>/dev/null) || WPA_PIDFILE=/tmp/setnet_wpapid_$$
WINDOW_WIDTH=75
WINDOW_HEIGHT=20
@@ -1175,14 +1173,17 @@ EOF
##function
initialise(){
- echo "TRUNCATE_LOG: ${TRUNCATE_LOG}"
+
+ TMPFILE=$( (tempfile) 2>/dev/null) || TMPFILE=/tmp/setnet_$$
+ WPA_PIDFILE=$( (tempfile) 2>/dev/null) || WPA_PIDFILE=/tmp/setnet_wpapid_$$
+
+ trap cleanup 0 NONE HUP INT TRAP TERM
if [ -z ${TRUNCATE_LOG} ] || \
[ ${TRUNCATE_LOG} = "yes" ] || \
[ ${TRUNCATE_LOG} = "YES" ]; then
truncate -s 0 ${LOGFILE}
fi
- trap cleanup 0 $SIG_NONE $SIG_HUP $SIG_INT $SIG_TRAP $SIG_TERM
}
@@ -1282,8 +1283,9 @@ initialise
check_deps
-
+##
+## This is the main loop
+##
main
-