Update to the udhcpc wrapper script. Ref #1890

This commit is contained in:
grossmj 2021-06-14 19:28:40 +09:30
parent 6a726d0344
commit c13f5c6627

View File

@ -1,8 +1,15 @@
#!/gns3/bin/busybox sh
SCRIPT="/gns3/etc/udhcpc/default.script"
EXTRA=""
[ "$(cat "/proc/$PPID/comm" 2>/dev/null)" = ifup ] && EXTRA="-t 3 -T 2 -A 1 -b"
if [ "$(cat "/proc/$PPID/comm" 2>/dev/null)" = ifup ]; then
# remove "-n" argument
for arg do
shift
[ "$arg" = "-n" ] || set -- "$@" "$arg"
done
# add default parameters
set -- -t 3 -T 2 -A 1 -b "$@"
fi
exec /tmp/gns3/bin/udhcpc -s "$SCRIPT" $EXTRA "$@"
exec /tmp/gns3/bin/udhcpc -s "$SCRIPT" "$@"