dhcpcd_dropwait_option 534 B

12345678910111213
  1. #!/bin/sh
  2. #GPL3 license (refer /usr/share/doc/legal).
  3. #usage ex: see /usr/local/simple_network_setup/rc.network, sns.
  4. #121118 rerwin: script created.
  5. #Form dropwait argument for dhcpcd, for option to delay abandonment of an intermittant connection. Returns null or (e.g.) -j 15
  6. DWOPTION="$(dhcpcd --help | grep -o '\--dropwait' | cut -f 1 -d ' ')"
  7. DWSECS="$(grep -o '^[0-9]*' /etc/dhcpcd_dropwait_secs 2>/dev/null)"
  8. [ -n "$DWOPTION" -a -n "$DWSECS" ] \
  9. && DROPWAIT="${DWOPTION} ${DWSECS}" || DROPWAIT=""
  10. echo -n "$DROPWAIT"
  11. exit 0