aboutsummaryrefslogtreecommitdiff
path: root/contrib/kiss-chroot
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/kiss-chroot')
-rwxr-xr-xcontrib/kiss-chroot4
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/kiss-chroot b/contrib/kiss-chroot
index 71bfbb2..cf0f31d 100755
--- a/contrib/kiss-chroot
+++ b/contrib/kiss-chroot
@@ -6,6 +6,8 @@ log() {
printf '\033[32m->\033[m %s.\n' "$*"
}
+usage() { printf '\033[1;33m-> \033[m%s\n' "usage: ${0##*/} <directory>" ; exit 0 ;}
+
die() {
log "$*" >&2
exit 1
@@ -24,7 +26,7 @@ clean() {
}
main() {
- [ -z "$1" ] && die Need a path to the chroot
+ [ "$1" ] || usage
[ -d "$1" ] || die Given path does not exist
[ "$(id -u)" = 0 ] || die Script needs to be run as root