diff --git a/net/mwan3/files/lib/mwan3/common.sh b/net/mwan3/files/lib/mwan3/common.sh index 62a736b37..3b1560897 100644 --- a/net/mwan3/files/lib/mwan3/common.sh +++ b/net/mwan3/files/lib/mwan3/common.sh @@ -6,6 +6,7 @@ get_uptime() { } SCRIPTNAME="$(basename "$0")" +MWAN3TRACK_STATUS_DIR="/var/run/mwan3track" LOG() { local facility=$1; shift diff --git a/net/mwan3/files/lib/mwan3/mwan3.sh b/net/mwan3/files/lib/mwan3/mwan3.sh index e9b3feda8..4d42f8954 100644 --- a/net/mwan3/files/lib/mwan3/mwan3.sh +++ b/net/mwan3/files/lib/mwan3/mwan3.sh @@ -24,7 +24,6 @@ IPv6_REGEX="${IPv6_REGEX}::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0- IPv6_REGEX="${IPv6_REGEX}([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])" MWAN3_STATUS_DIR="/var/run/mwan3" -MWAN3TRACK_STATUS_DIR="/var/run/mwan3track" MWAN3_INTERFACE_MAX="" DEFAULT_LOWEST_METRIC=256 MMX_MASK="" diff --git a/net/mwan3/files/usr/sbin/mwan3track b/net/mwan3/files/usr/sbin/mwan3track index a48df72b5..863eb76ff 100755 --- a/net/mwan3/files/usr/sbin/mwan3track +++ b/net/mwan3/files/usr/sbin/mwan3track @@ -73,9 +73,9 @@ disconnected() { } connected() { - echo "online" > /var/run/mwan3track/$INTERFACE/STATUS - echo "0" > /var/run/mwan3track/$INTERFACE/OFFLINE - get_uptime > /var/run/mwan3track/$INTERFACE/ONLINE + echo "online" > $MWAN3TRACK_STATUS_DIR/$INTERFACE/STATUS + echo "0" > $MWAN3TRACK_STATUS_DIR/$INTERFACE/OFFLINE + get_uptime > $MWAN3TRACK_STATUS_DIR/$INTERFACE/ONLINE host_up_count=0 lost=0 turn=0 @@ -96,10 +96,10 @@ firstconnect() { update_status() { local track_ip=$1 - echo "$2" > /var/run/mwan3track/$INTERFACE/TRACK_${track_ip} + echo "$2" > $MWAN3TRACK_STATUS_DIR/$INTERFACE/TRACK_${track_ip} [ -z "$3" ] && return - echo "$3" > /var/run/mwan3track/$INTERFACE/LATENCY_${track_ip} - echo "$4" > /var/run/mwan3track/$INTERFACE/LOSS_${track_ip} + echo "$3" > $MWAN3TRACK_STATUS_DIR/$INTERFACE/LATENCY_${track_ip} + echo "$4" > $MWAN3TRACK_STATUS_DIR/$INTERFACE/LOSS_${track_ip} } main() { @@ -280,7 +280,7 @@ main() { lost=0 if [ $score -gt $up ]; then - echo "online" > /var/run/mwan3track/$INTERFACE/STATUS + echo "online" > $MWAN3TRACK_STATUS_DIR/$INTERFACE/STATUS score=$((down+up)) elif [ $score -le $up ]; then sleep_time=$recovery_interval @@ -292,11 +292,11 @@ main() { fi let turn++ - mkdir -p "/var/run/mwan3track/${1}" - echo "${lost}" > /var/run/mwan3track/$INTERFACE/LOST - echo "${score}" > /var/run/mwan3track/$INTERFACE/SCORE - echo "${turn}" > /var/run/mwan3track/$INTERFACE/TURN - get_uptime > /var/run/mwan3track/$INTERFACE/TIME + mkdir -p "$MWAN3TRACK_STATUS_DIR/${1}" + echo "${lost}" > $MWAN3TRACK_STATUS_DIR/$INTERFACE/LOST + echo "${score}" > $MWAN3TRACK_STATUS_DIR/$INTERFACE/SCORE + echo "${turn}" > $MWAN3TRACK_STATUS_DIR/$INTERFACE/TURN + get_uptime > $MWAN3TRACK_STATUS_DIR/$INTERFACE/TIME host_up_count=0 sleep "${sleep_time}" &