source: src-sh/warden/install.sh @ 0988d23

9.1-release9.2-releasereleng/10.0releng/10.0.1
Last change on this file since 0988d23 was 0988d23, checked in by Kris Moore <kris@…>, 13 months ago

Add my working directory for the new warden backend changes.

Includes patches from John Hixson (john@…) to change
how warden uses "nicknames" instead of IP addresses for jail
identification.

  • Property mode set to 100755
File size: 1.5 KB
Line 
1#!/bin/sh
2# Warden install script
3PROGDIR="/usr/local/share/warden"
4
5mkdir -p ${PROGDIR} >/dev/null 2>/dev/null
6
7mkdir ${PROGDIR}/tmp >/dev/null 2>/dev/null
8mkdir ${PROGDIR}/export >/dev/null 2>/dev/null
9
10DIR=`dirname $0`
11cd ${DIR}
12
13cp bin/warden /usr/local/bin/warden
14chmod 755 /usr/local/bin/warden
15
16# Save existing settings
17if [ -e "/usr/local/etc/warden.conf" ] ; then
18  NIC=`grep '^NIC:' /usr/local/etc/warden.conf | awk '{print $2}'`
19  WTMP=`grep '^WTMP:' /usr/local/etc/warden.conf | awk '{print $2}'`
20  JDIR=`grep '^JDIR:' /usr/local/etc/warden.conf | awk '{print $2}'`
21  ONIC=`grep '^NIC:' conf/warden.conf`
22  OWTMP=`grep '^WTMP:' conf/warden.conf`
23  OJDIR=`grep '^JDIR:' conf/warden.conf`
24fi
25
26cp conf/warden.conf /usr/local/etc/warden.conf
27chmod 644 /usr/local/etc/warden.conf
28
29# Save the settings
30if [ -n "$NIC" ] ; then
31   sed -i '' "s|$ONIC|NIC: $NIC|g" /usr/local/etc/warden.conf
32   sed -i '' "s|$OWTMP|WTMP: $WTMP|g" /usr/local/etc/warden.conf
33   sed -i '' "s|$OJDIR|JDIR: $JDIR|g" /usr/local/etc/warden.conf
34fi
35
36if [ -d "${PROGDIR}/linux-installs" ] ; then
37  rm -rf ${PROGDIR}/linux-installs
38fi
39cp -r linux-installs ${PROGDIR}
40
41if [ -d "${PROGDIR}/scripts" ] ; then
42  rm -rf ${PROGDIR}/scripts
43fi
44
45cp -r scripts ${PROGDIR}
46chmod 755 ${PROGDIR}/scripts/backend/*
47
48# Setup rc.d
49cp scripts/rc.d/wardenrc /usr/local/etc/rc.d/wardenrc
50chmod 755 /usr/local/etc/rc.d/wardenrc
51
52cp agent.png ${PROGDIR}/
53cp agent.png ${PROGDIR}/warden.png
54
55mkdir ${PROGDIR}/bin >/dev/null 2>/dev/null
56
57exit 0
Note: See TracBrowser for help on using the repository browser.