Remove secondary DNS fallback

This commit is contained in:
Kroese 2023-04-18 17:34:51 +02:00 committed by GitHub
commit 44a982f2fb
4 changed files with 10 additions and 5 deletions

View File

@ -8,6 +8,7 @@ status() {
echo 'Service running'
return 1
fi
return 0
}
start() {
@ -15,9 +16,11 @@ start() {
echo 'Service already running'
return 1
fi
echo "-" > /var/lock/subsys/agent.sh
echo 'Starting agent service...'
chmod 666 /dev/ttyS0
"$SCRIPT" &> /dev/ttyS0 & echo $! > "$PIDFILE"
return 0
}
stop() {
@ -25,11 +28,13 @@ stop() {
echo 'Service not running'
return 1
fi
rm -f /var/lock/subsys/agent.sh
echo 'Stopping agent service...'
chmod 666 /dev/ttyS0
echo 'Stopping agent service...' > /dev/ttyS0
kill -15 "$(cat "$PIDFILE")" && rm -f "$PIDFILE"
echo 'Service stopped'
return 0
}
case "$1" in
@ -48,4 +53,6 @@ case "$1" in
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac

View File

@ -155,12 +155,12 @@ mv $PKG/ $LOC/
LOC="$MOUNT/usr/local/bin"
mkdir -p $LOC
cp /agent/agent.sh $LOC/agent.sh
chmod +x $LOC/agent.sh
chmod 755 $LOC/agent.sh
LOC="$MOUNT/usr/local/etc/rc.d"
mkdir -p $LOC
cp /agent/service.sh $LOC/agent.sh
chmod +x $LOC/agent.sh
chmod 755 $LOC/agent.sh
# Store agent version
echo "5" > "$STORAGE"/"$BASE".agent

View File

@ -75,7 +75,6 @@ for nameserver in "${nameservers[@]}"; do
done
[[ -z $DNS_SERVERS ]] && DNS_SERVERS="1.1.1.1"
[[ ${DNS_SERVERS} != *","* ]] && DNS_SERVERS="$DNS_SERVERS,1.0.0.1"
DNSMASQ_OPTS="$DNSMASQ_OPTS --dhcp-option=option:dns-server,$DNS_SERVERS --dhcp-option=option:router,${VM_NET_IP%.*}.1"

View File

@ -52,5 +52,4 @@ set -m
)
set +m
pidwait -F "${_QEMU_PID}" &
wait $!
pidwait -F "${_QEMU_PID}" & wait $!