summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-09-13 11:37:07 +0200
committerFlorian Pritz <bluewind@xinu.at>2017-09-13 11:37:07 +0200
commite109307c8b33944508fa1958701181909bbeb5c0 (patch)
tree5932b3c8fa34ab8430f5484f2824d66687ae965a
parent9fe77b84437fd26211d5dda7b6ccb0b64040677e (diff)
downloadbin-e109307c8b33944508fa1958701181909bbeb5c0.tar.gz
bin-e109307c8b33944508fa1958701181909bbeb5c0.tar.xz
ch: check permissions of $CHROOT directory
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xch5
1 files changed, 5 insertions, 0 deletions
diff --git a/ch b/ch
index bcc759b..00def24 100755
--- a/ch
+++ b/ch
@@ -39,6 +39,11 @@ shopt -s nullglob
umask 022
+if [[ ! -d "$CHROOTS" ]]; then
+ echo "chroot base directory '$CHROOTS' does not exist or is not readable"
+ return 1
+fi
+
__genchroot() {
sudo btrfs subvolume snapshot "$chrootdir/root" "$copydir"
}