diff options
Diffstat (limited to 'share/scripts')
-rwxr-xr-x | share/scripts/curl | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/share/scripts/curl b/share/scripts/curl index 6a9f784..8af1446 100755 --- a/share/scripts/curl +++ b/share/scripts/curl @@ -25,7 +25,7 @@ CACHE="/var/cache/container-tools/curl" Parameters () { - LONG_OPTIONS="bind:,script:,name:,image:,server:,password:" + LONG_OPTIONS="bind:,script:,name:,clean,image:,server:,password:" OPTIONS="b:,s:,n:,p:" PARAMETERS="$(getopt --longoptions ${LONG_OPTIONS} --name=${SCRIPT} --options ${OPTIONS} --shell sh -- ${@})" @@ -61,6 +61,11 @@ Parameters () shift 2 ;; + --clean) + CLEAN="true" + shift 1 + ;; + --image) IMAGE="${2}" shift 2 @@ -91,7 +96,7 @@ Parameters () Usage () { - echo "Usage: container create -n|--name NAME -s|--script ${SCRIPT} -- [--image IMAGE] [--server SERVER] [-p|--password PASSWORD}" >&2 + echo "Usage: container create -n|--name NAME -s|--script ${SCRIPT} -- [--clean] [--image IMAGE] [--server SERVER] [-p|--password PASSWORD}" >&2 exit 1 } @@ -190,3 +195,10 @@ cp -L /etc/resolv.conf "${MACHINES}/${NAME}/etc/resolv.conf" # Setting root password echo root:${PASSWORD} | chroot "${MACHINES}/${NAME}" chpasswd echo "${NAME}: root password set to '${PASSWORD}'." + +# Reove cache +case "${CLEAN}" in + true) + rm -f "${CACHE}/${IMAGE}" + ;; +esac |