Little installer improvments

`set -e` enables exit when received non-zero exit code
This commit is contained in:
ElXreno 2020-04-14 09:29:44 +03:00 committed by GitHub
parent 91dee66ef3
commit 71e766e4aa

View file

@ -1,5 +1,7 @@
#!/bin/sh #!/bin/sh
set -e
if [ $EUID != 0 ]; then if [ $EUID != 0 ]; then
sudo "$0" "$@" sudo "$0" "$@"
exit $? exit $?
@ -10,6 +12,7 @@ CONFIG=$1
if [ -z "$CONFIG" ] if [ -z "$CONFIG" ]
then then
echo "path to config to use as configuration.nix needs to be passed as first argument" echo "path to config to use as configuration.nix needs to be passed as first argument"
exit 1
else else
echo "using configuration: '$CONFIG'" echo "using configuration: '$CONFIG'"
fi fi