From 167a3591ba2eae23a58bf7b160154e272dd516f4 Mon Sep 17 00:00:00 2001 From: Zeno Zeng Date: Sun, 21 Sep 2014 20:14:50 +0800 Subject: [PATCH] restart xl2tpd only if necessary --- xl2tpd.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xl2tpd.sh b/xl2tpd.sh index b49396d..48e29d0 100755 --- a/xl2tpd.sh +++ b/xl2tpd.sh @@ -109,13 +109,17 @@ connect() { case $1 in connect) - xl2tpd_restart + if [ ! -e $L2TPD_CONTROL_FILE ]; then + xl2tpd_restart + fi xl2tpd_create_lac connect ;; disconnect) xl2tpd-control disconnect ${LAC_NAME} + tail $PPP_LOG_FILE + echo -n > $PPP_LOG_FILE ;; esac