Ignore:
Timestamp:
01/16/14 08:50:15 (12 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
58a4795
Parents:
0542f38
Message:

Fix up exporting jails via the warden GUI.

While here, I made the export process a bit more "chatty" so the user
knows whats going on.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/warden/scripts/backend/exportjail.sh

    r1fffaadd r4efda4d  
    1212JAILNAME="$1" 
    1313OUTDIR="$2" 
     14 
     15if [ -z "${OUTDIR}" ]; then OUTDIR="$WTMP" ; fi 
    1416 
    1517if [ -z "${EXPORTNAME}" ] 
     
    3638 
    3739# First check if this jail is running, and stop it 
     40echo "Checking jail status..." 
    3841${PROGDIR}/scripts/backend/checkstatus.sh "${EXPORTNAME}" 
    3942if [ "$?" = "0" ] 
    4043then 
     44  echo "Stopping jail for export..." 
    4145  ${PROGDIR}/scripts/backend/stopjail.sh "${EXPORTNAME}" 
    4246fi 
     
    6468MASK6="${JMASK}" 
    6569 
    66 echo "Creating compressed archive of ${EXPORTNAME}... Please Wait..." >&1 
     70echo "Creating compressed archive of ${EXPORTNAME}... Please Wait..." 
    6771tar cvJf "${WTMP}/${EXPORTNAME}.txz" -C "${JAILDIR}" . 2>${WTMP}/${EXPORTNAME}.files 
    6872 
    6973cd ${WTMP} 
    7074 
     75echo "Creating jail metadata..." 
    7176LINES="`wc -l ${EXPORTNAME}.files | sed -e 's, ,,g' | cut -d '.' -f 1`" 
    7277 
     
    109114done 
    110115 
    111 if [ ! -z "${OUTDIR}" ] 
    112 then 
    113   mkdir -p ${OUTDIR} 2>/dev/null 
     116if [ ! -d "$OUTDIR" ] ; then 
     117  mkdir -p ${OUTDIR} 
     118fi 
     119if [ "$OUTDIR" != "$WTMP" ] ; then 
    114120  mv ${EXPORTNAME}.wdn ${OUTDIR}/ 
    115   echo "Created ${EXPORTNAME}.wdn in ${OUTDIR}" >&1 
    116 else  
    117   echo "Created ${EXPORTNAME}.wdn in ${WTMP}" >&1 
    118121fi 
     122echo "Created ${EXPORTNAME}.wdn in ${OUTDIR}" >&1 
    119123 
    120124exit 0 
Note: See TracChangeset for help on using the changeset viewer.