Changeset 283f63e


Ignore:
Timestamp:
05/03/13 06:08:35 (17 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
8939700
Parents:
23f9583f
Message:

Add support for listing / deleting templates

File:
1 edited

Legend:

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

    r101a6c2 r283f63e  
    996996     ls ${JDIR}/.warden-template*.tbz | sed "s|${JDIR}/.warden-template-||g" | sed "s|.tbz||g" 
    997997   fi 
     998   exit 0 
    998999} 
    9991000 
    10001001delete_template() 
    10011002{ 
    1002    
    1003  
    1004 } 
     1003   tDir="${JDIR}/.warden-template-${1}" 
     1004   isDirZFS "${JDIR}" 
     1005   if [ $? -eq 0 ] ; then 
     1006     isDirZFS "${tDir}" "1" 
     1007     if [ $? -ne 0 ] ; then printerror "Not a ZFS volume: ${tDir}" ; fi 
     1008     tank=`getZFSTank "$tDir"` 
     1009     rp=`getZFSRelativePath "$tDir"` 
     1010     zfs destroy -r $tank${rp} 
     1011     rmdir ${tDir} 
     1012   else 
     1013     if [ ! -e "${tDir}.tbz" ] ; then 
     1014       exit_err "No such template: ${1}" 
     1015     fi 
     1016     rm ${tDir}.tbz 
     1017   fi 
     1018 
     1019   exit 0 
     1020} 
Note: See TracChangeset for help on using the changeset viewer.