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