openfortivpn: fix shellcheck warnings

Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
This commit is contained in:
Aaron Goodman
2020-09-10 17:56:10 -04:00
parent 7d170b8f64
commit c4686691aa
2 changed files with 12 additions and 13 deletions
+3 -3
View File
@@ -23,19 +23,19 @@ trap_with_arg() {
func_trap() {
logger "openfortivpn-wrapper[$$]" "$config: sending signal ${1}"
killed=1
kill -${1} $child 2>/dev/null
kill "-${1}" "$child" 2>/dev/null
}
trap_with_arg func_trap INT TERM KILL
start_time=$(date '+%s')
/usr/sbin/openfortivpn "$@" < $pwfile 2>/dev/null &
/usr/sbin/openfortivpn "$@" < "$pwfile" 2>/dev/null &
child=$!
wait $child || {
[ "$killed" = 1 ] && exit 0
current_time=$(date '+%s')
elapsed=$(($current_time-$start_time))
elapsed=$((current_time-start_time))
. /lib/netifd/netifd-proto.sh
proto_notify_error "$config" "Failed to connect after $elapsed seconds."
proto_block_restart "$config"