1
0
mirror of https://github.com/QSCTech/zjunet.git synced 2026-01-23 04:04:48 +08:00

check if xl2tpd is up, fixes #41

This commit is contained in:
Zeno Zeng 2014-10-13 21:37:22 +08:00
parent c8003380d6
commit 9c544fb8f3
2 changed files with 22 additions and 7 deletions

View File

@ -60,6 +60,9 @@ connect() {
# #
##################################### #####################################
# start xl2tpd if not
"${BASEDIR}/sudo.sh" "${BASEDIR}/xl2tpd.sh" trystart
case "$1" in case "$1" in
-d) -d)

View File

@ -58,13 +58,6 @@ xl2tpd_start() {
type systemctl >/dev/null 2>&1 && { type systemctl >/dev/null 2>&1 && {
systemctl xl2tpd start systemctl xl2tpd start
} }
}
xl2tpd_restart() {
xl2tpd_stop
rm -f ${XL2TPD_CONTROL_FILE}
xl2tpd_start
# wait until ready # wait until ready
for i in $(seq 0 10); do for i in $(seq 0 10); do
@ -79,6 +72,20 @@ xl2tpd_restart() {
exit 1 exit 1
} }
xl2tpd_trystart() {
if [ -e ${XL2TPD_CONTROL_FILE} ]; then
echo "[INFO] xl2tpd ready."
else
xl2tpd_start
fi
}
xl2tpd_restart() {
xl2tpd_stop
rm -f ${XL2TPD_CONTROL_FILE}
xl2tpd_start
}
xl2tpd_create_lac() { xl2tpd_create_lac() {
#touch $PPP_LOG_FILE #touch $PPP_LOG_FILE
@ -164,6 +171,11 @@ case $1 in
xl2tpd_restart xl2tpd_restart
;; ;;
trystart)
# will start unless already started
xl2tpd_trystart
;;
adduser) adduser)
xl2tpd_create_lac xl2tpd_create_lac
;; ;;