]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/ipfilter/FreeBSD-4.0/unkinstall
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / ipfilter / FreeBSD-4.0 / unkinstall
1 #!/bin/csh -f
2 #
3 #
4 set dir=`pwd`
5 set karch=`uname -m`
6 set krev=`uname -r|sed -e 's/\([0-9\.]*\)-.*/\1/'`
7 if ( -d /sys/arch/$karch ) set archdir="/sys/arch/$karch"
8 if ( -d /sys/$karch ) set archdir="/sys/$karch"
9 set confdir="$archdir/conf"
10
11 if ( $dir =~ */FreeBSD* ) cd ..
12 echo -n "Uninstalling "
13 foreach i (ip_fil.[ch] ip_nat.[ch] ip_frag.[ch] ip_state.[ch] fil.c \
14            ip_auth.[ch] ip_proxy.[ch] ip_{ftp,rcmd,raudio}_pxy.c ip_compat.h \
15            ip_log.c mlf_ipl.c ipl.h)
16         echo -n "$i ";
17         /bin/rm -f /sys/netinet/$i
18 end
19 echo ""
20
21 echo "Removing link from /usr/include/osreldate.h to /sys/sys/osreldate.h"
22 rm /sys/sys/osreldate.h
23
24 echo "Removing patch to ip6_input.c and ip6_output.c"
25 cat FreeBSD-4.0/ipv6-patch-$krev | (cd /sys/netinet6; patch -R)
26
27 set config=`(cd $confdir; /bin/ls -1t [0-9A-Z_]*) | head -1`
28 echo -n "Kernel configuration to update [$config] "
29 set newconfig=$<
30 if ( "$newconfig" != "" ) then
31         set config="$confdir/$newconfig"
32 else
33         set newconfig=$config
34 endif
35 if ( -f $confdir/$newconfig ) then
36         mv $confdir/$newconfig $confdir/$newconfig.bak
37 endif
38 if ( -d $archdir/../compile/$newconfig ) then
39         set bak=".bak"
40         set dot=0
41         while ( -d $archdir/../compile/${newconfig}.${bak} )
42                 set bak=".bak.$dot"
43                 set dot=`expr 1 + $dot`
44         end
45         mv $archdir/../compile/$newconfig $archdir/../compile/${newconfig}.${bak}
46 endif
47 egrep -v IPFILTER $confdir/$newconfig.bak > $confdir/$newconfig
48 echo 'You will now need to run "config" and build a new kernel.'
49 exit 0