source: src-sh/warden/scripts/rc.d/shutdown.sh @ 29c3581

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

Use the correct names to start / stop jails when running from rc.d

  • Property mode set to 100755
File size: 784 bytes
Line 
1#!/bin/sh
2# Starts up the warden service
3######################################################################
4
5PATH="${PATH}:/usr/local/bin:/usr/local/sbin"
6export PATH
7
8# Source our functions
9PROGDIR="/usr/local/share/warden"
10
11if [ -z "${PROGDIR}" ]
12then
13   echo "PROGDIR unset! Is The Warden installed properly?"
14   exit 155
15fi
16
17# Source our variables
18. ${PROGDIR}/scripts/backend/functions.sh
19
20echo "Stopping the Warden"
21
22# If no jails we can exit
23if [ ! -d "${JDIR}" ] ; then exit 0 ; fi
24
25cd ${JDIR}
26for i in `ls -d .*.meta 2>/dev/null`
27do
28  JAILNAME=`echo ${i}|sed 's|.meta$||'|sed 's|^.||'`
29
30  ${PROGDIR}/scripts/backend/checkstatus.sh "${JAILNAME}" 2>/dev/null
31  if [ "$?" = "0" ] ; then
32    echo "Stopping jail (${JAILNAME})"
33    warden stop "${JAILNAME}" "FAST"
34  fi
35done
36
Note: See TracBrowser for help on using the repository browser.