source: src-sh/warden/install.sh @ c60c604

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3releng/10.1
Last change on this file since c60c604 was c60c604, checked in by Kris Moore <kris@…>, 13 months ago

Add a new "mkports.sh" helper script, which will convert the git tree into
the pcbsd-utils & pcbsd-utils-qt4 ports.

While here, convert the pcbsd-utils port to use STAGING

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