dhcpcd.exit-hook 462 B

12345678910111213141516171819202122
  1. ap_start () {
  2. service hostapd restart
  3. service dnsmasq restart
  4. iptables-restore < /etc/iptables.ipv4.nat
  5. }
  6. ap_stop () {
  7. service hostapd stop
  8. service dnsmasq stop
  9. iptables-restore < /etc/iptables.ipv4.nonat
  10. }
  11. if [ "$interface" = wlan0 ]; then
  12. case "$reason" in
  13. PREINIT) (sleep 3; ap_start > /dev/null 2>&1) & ;;
  14. DEPARTED) (sleep 3; ap_stop > /dev/null 2>&1) & ;;
  15. esac
  16. fi
  17. if $if_up; then
  18. (sleep 3; chronyc online > /dev/null 2>&1) &
  19. fi