summaryrefslogtreecommitdiff
path: root/debootstrap.sh
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2018-06-12 15:47:18 -0400
committerAndrew Cady <d@jerkface.net>2018-06-13 17:13:53 -0400
commit9978ef7b4a692eb961d396b80a51bd1f9a88cad6 (patch)
treec9b85c26d6f66edb103bdda20bd83a964b9d0850 /debootstrap.sh
parent34dbe10ca8ab17dc6c250a5c547bd47584a8105c (diff)
add "rm" command
Diffstat (limited to 'debootstrap.sh')
-rwxr-xr-xdebootstrap.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/debootstrap.sh b/debootstrap.sh
index 2ce7e2c..1b88a86 100755
--- a/debootstrap.sh
+++ b/debootstrap.sh
@@ -234,6 +234,18 @@ new()
234 cp --reflink=always "$source" "$dest" 234 cp --reflink=always "$source" "$dest"
235} 235}
236 236
237rm_image()
238{
239 suite=$1
240 name=$2
241 [ "$suite" -a "$name" ] || usage
242 image_basename=$imgdir/$(suite_to_basename "$suite") || die 'suite_to_basename'
243 source=$image_basename
244 dest=${source%.btrfs}.$name.btrfs
245
246 rm -i "$dest"
247}
248
237init() 249init()
238{ 250{
239 suite=$1 251 suite=$1
@@ -296,6 +308,6 @@ show()
296 308
297case "$1" in 309case "$1" in
298 init|new|clone|list|show) cmd=$1; shift; $cmd "$@" ;; 310 init|new|clone|list|show) cmd=$1; shift; $cmd "$@" ;;
299 chroot|sh) cmd=${1}_image; shift; $cmd "$@" ;; 311 chroot|sh|rm) cmd=${1}_image; shift; $cmd "$@" ;;
300 *) usage ;; 312 *) usage ;;
301esac 313esac