2012-02-20 19:20:55 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# 2012 Jake Guffey (jake.guffey at eprotex.com)
|
|
|
|
#
|
|
|
|
# This file is part of cdist.
|
|
|
|
#
|
|
|
|
# cdist is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# cdist is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
#
|
2012-04-27 15:45:34 +00:00
|
|
|
# See if the jailbase.tgz or $jaildir/base dir exists
|
2012-02-20 19:20:55 +00:00
|
|
|
#
|
|
|
|
|
2012-02-23 22:17:30 +00:00
|
|
|
# Debug
|
|
|
|
#exec >&2
|
|
|
|
#set -x
|
|
|
|
|
2012-04-27 15:45:34 +00:00
|
|
|
if [ -f "$__object/parameter/jaildir" ]; then
|
2014-03-25 16:50:27 +00:00
|
|
|
jaildir="$(cat "$__object/parameter/jaildir")"
|
2012-04-27 15:45:34 +00:00
|
|
|
else
|
|
|
|
jaildir="/usr/jail"
|
|
|
|
fi
|
|
|
|
|
2012-02-20 19:20:55 +00:00
|
|
|
name="base:jailbase.tgz"
|
2012-02-23 22:17:30 +00:00
|
|
|
out=""
|
2012-02-20 19:20:55 +00:00
|
|
|
|
|
|
|
save_IFS="$IFS"
|
|
|
|
IFS=":"
|
|
|
|
for cur in $name; do
|
2012-04-27 15:45:34 +00:00
|
|
|
if [ -e "${jaildir}/$cur" ]; then
|
2012-02-23 22:17:30 +00:00
|
|
|
out="${out}:${cur}"
|
2012-02-20 19:20:55 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
IFS="$save_IFS"
|
|
|
|
|
2012-02-23 22:17:30 +00:00
|
|
|
if [ -z "$out" ]; then
|
2012-02-20 19:20:55 +00:00
|
|
|
echo "NONE"
|
|
|
|
else
|
2012-02-23 22:17:30 +00:00
|
|
|
echo "${out}"
|
2012-02-20 19:20:55 +00:00
|
|
|
fi
|
|
|
|
|
2012-02-23 22:17:30 +00:00
|
|
|
# Debug
|
|
|
|
#set +x
|
|
|
|
|