add proper exit status
This commit is contained in:
parent
842099ac8c
commit
a4c383bfd0
1 changed files with 5 additions and 5 deletions
10
polystrap.sh
10
polystrap.sh
|
@ -49,12 +49,12 @@ while getopts s:a:d:m:p: opt; do
|
||||||
done
|
done
|
||||||
shift $(($OPTIND - 1))
|
shift $(($OPTIND - 1))
|
||||||
|
|
||||||
[ "$#" -ne 1 ] && { echo "too many positional arguments"; usage; exit; }
|
[ "$#" -ne 1 ] && { echo "too many positional arguments"; usage; exit 1; }
|
||||||
|
|
||||||
PLATFORM="$1"
|
PLATFORM="$1"
|
||||||
|
|
||||||
[ ! -r "$PLATFORM" ] && { echo "cannot find target directory: $PLATFORM"; exit; }
|
[ ! -r "$PLATFORM" ] && { echo "cannot find target directory: $PLATFORM"; exit 1; }
|
||||||
[ ! -r "$PLATFORM/multistrap.conf" ] && { echo "cannot read multistrap config: $PLATFORM/multistrap.conf"; exit; }
|
[ ! -r "$PLATFORM/multistrap.conf" ] && { echo "cannot read multistrap config: $PLATFORM/multistrap.conf"; exit 1; }
|
||||||
|
|
||||||
# source default options
|
# source default options
|
||||||
. "default/config"
|
. "default/config"
|
||||||
|
@ -89,8 +89,8 @@ echo "mirror: $MIRROR"
|
||||||
echo "pkgs: $PACKAGES"
|
echo "pkgs: $PACKAGES"
|
||||||
echo "--------------------------"
|
echo "--------------------------"
|
||||||
|
|
||||||
[ -e "$ROOTDIR.tar" ] && { echo "tarball still exists"; exit; }
|
[ -e "$ROOTDIR.tar" ] && { echo "tarball still exists"; exit 1; }
|
||||||
[ -e "$ROOTDIR" ] && { echo "root directory still exists"; exit; }
|
[ -e "$ROOTDIR" ] && { echo "root directory still exists"; exit 1; }
|
||||||
|
|
||||||
# create multistrap.conf
|
# create multistrap.conf
|
||||||
MULTISTRAPCONF=`tempfile -d . -p multistrap`
|
MULTISTRAPCONF=`tempfile -d . -p multistrap`
|
||||||
|
|
Loading…
Reference in a new issue