diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/templatepkg | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/templatepkg b/src/templatepkg index d2a23aa..1382759 100755 --- a/src/templatepkg +++ b/src/templatepkg @@ -47,7 +47,11 @@ function usage { echo " file-name: the file or directory to be added" echo " jail-root: the jail under file-name is located" echo "" - echo " in all cases, jail-root defaults to / if ommited" + echo " -d | --delete: delete files or folders from a template; arguments are:" + echo "" + echo " $BASENAME -d <template> <file-name>" + echo "" + echo " in all cases (-c, -u and -a), jail-root defaults to /, if ommited" echo "" exit 1 @@ -192,6 +196,24 @@ elif [ "$1" == "-a" ] || [ "$1" == "--add" ]; then template_add $ROOT $3 +elif [ "$1" == "-d" ] || [ "$1" == "--delete" ]; then + + if [ -z "$3" ]; then + usage + else + + if [ -a "$TEMPLATE_BASE.d/$3" ]; then + if [ "$TEMPLATES_UNDER_SVN" == "1" ]; then + cd $TEMPLATE_BASE + svn del --force ./$3 || rm -rf ./$3 + echo $BASENAME: please run jail-commit to del $3 in the svn repository + else + rm -rf $TEMPLATE_BASE.d/$3 + fi + fi + + fi + else usage fi |