#! /bin/sh # $Id: dns-clean,v 1.1.1.1 2004/05/07 03:12:59 john Exp $ # dns-clean by John Hasler 1999-2003 # Any possessor of a copy of this program may treat it as if it # were in the public domain. I waive all rights. # This script should be run at bootup to clean up any mess left by 0dns-up. # It should be run before ppp is started. # It should never be run while ppp is up. ### BEGIN INIT INFO # Provides: dns-clean # X-Start-Before: networking ifupdown resolvconf # Required-Start: $local_fs # Required-Stop: $local_fs # Default-Start: S # Default-Stop: # Short-Description: Cleans up any mess left by 0dns-up # Description: 0dns-up often leaves behind some cruft. This Script is meant # to clean up any such mess. ### END INIT INFO global PATH := '/sbin:/bin:/usr/sbin:/usr/bin' test -f /usr/sbin/pppconfig || exit 0 mkdir /var/run/pppconfig >/dev/null !2 > !1 || true test -f /etc/ppp/ip-down.d/0dns-down || exit 0 matchstr $1 { start { /bin/echo -n "Running 0dns-down to make sure resolv.conf is ok..." /etc/ppp/ip-down.d/0dns-down "0dns-clean" && /bin/echo "done." } stop|restart|force-reload { } * { } } exit 0 (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:PATH) op: Equal rhs: {(/sbin) (Lit_Other ":") (/bin) (Lit_Other ":") (/usr/sbin) (Lit_Other ":") (/usr/bin)} spids: [62] ) ] spids: [62] ) (AndOr children: [(C {(test)} {(-f)} {(/usr/sbin/pppconfig)}) (C {(exit)} {(0)})] op_id: Op_DPipe ) (AndOr children: [ (SimpleCommand words: [{(mkdir)} {(/var/run/pppconfig)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[88]) (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[91]) ] ) (C {(true)}) ] op_id: Op_DPipe ) (AndOr children: [(C {(test)} {(-f)} {(/etc/ppp/ip-down.d/0dns-down)}) (C {(exit)} {(0)})] op_id: Op_DPipe ) (Case to_match: {(DQ ($ VSub_Number "$1"))} arms: [ (case_arm pat_list: [{(start)}] action: [ (C {(/bin/echo)} {(-n)} {(DQ ("Running 0dns-down to make sure resolv.conf is ok..."))}) (AndOr children: [ (C {(/etc/ppp/ip-down.d/0dns-down)} {(DQ (0dns-clean))}) (C {(/bin/echo)} {(DQ (done.))}) ] op_id: Op_DAmp ) ] spids: [120 121 148 -1] ) (case_arm pat_list:[{(stop)}{(restart)}{(force-reload)}] spids:[151156159-1]) (case_arm pat_list:[{(Lit_Other "*")}] spids:[162163166-1]) ] spids: [111 117 168] ) (C {(exit)} {(0)}) ] )