]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - HPUX/IPF-ALL/preinstall
Import IP-Filter 5.1.2 into vendor branches using the existing license that
[FreeBSD/FreeBSD.git] / HPUX / IPF-ALL / preinstall
1 #! /sbin/sh
2 ########
3 #  Product: IP Filter
4 #  Fileset: IPF-ALL
5 #  preinstall
6 ########
7 #
8 # (c) Copyright (C) 2012 by Darren Reed.
9 #
10 ########
11
12 ########
13 # Source control script environment
14 ########
15
16 UTILS="/usr/lbin/sw/control_utils"
17 if [[ ! -f $UTILS ]] ; then
18         echo "ERROR: Cannot find $UTILS"
19         exit 1
20 fi
21 . $UTILS
22 exitval=$SUCCESS
23
24 CONTRIBDIR=/usr/contrib/ipf
25 ETCDIR=/etc/opt/ipf
26
27 ########
28 # Create directories so that installation can take place
29 ########
30
31 if [[ ! -d ${ETCDIR} ]]; then
32         mkdir -m 755 -p ${ETCDIR}
33 fi
34
35 for i in ipf.conf ipnat.conf; do
36         touch ${ETCDIR}/$i
37         chmod 444 ${ETCDIR}/$i
38 done
39
40 if [[ ! -d ${CONTRIBDIR} ]]; then
41         mkdir -m 755 -p ${CONTRIBDIR}
42 fi
43
44 for i in bin man include examples; do
45         if [[ ! -d ${CONTRIBDIR}/$i ]]; then
46                 mkdir -m 755 -p ${CONTRIBDIR}/$i
47         fi
48 done
49
50 exit $exitval