#!/bin/sh
#----------------------------------------------------------------------------
# /etc/ppp/ip-down800.dnsmasq - called whenever a (i)ppp connection
# over default circuit has been come down and dnsmasq is installed
#
# Creation:     ??.??.2003  lanspezi
# Last Update:  $Id: ip-down800.dnsmasq 8079 2005-03-23 21:22:53Z lanspezi $
#----------------------------------------------------------------------------
# restore etc/resolv.dnsmasq from etc/resolv.dnsmasq.bak
#----------------------------------------------------------------------------

resolv_file=/etc/resolv.dnsmasq

# is a default-route-interface going down & etc/resolv.dnsmasq.bak exist?
if [ "$is_default_route" = "yes" -a -f $resolv_file.bak ]
  then
  # yes, restore etc/resolv.dnsmasq
  mv $resolv_file.bak $resolv_file
  chown dns:dns $resolv_file
  killall -HUP dnsmasq
  echo "$resolv_file restored."
fi
