fix: Add root user checks, auto-remove .git from the iso

This commit is contained in:
ngn 2024-02-22 22:19:01 +03:00
parent d572b4b94e
commit 710a0048f0
2 changed files with 9 additions and 0 deletions

View File

@ -51,6 +51,10 @@ check_ret() {
#################
## main script ##
#################
if [ "$EUID" -ne 0 ]; then
error "You should run this script as root"
fi
if [ $# -eq 0 ]; then
error "Please specify a name for the archive"
fi

View File

@ -99,6 +99,10 @@ check_iso_vars() {
#################
## main script ##
#################
if [ "$EUID" -ne 0 ]; then
error "You should run this script as root"
fi
if [ $# -ne 2 ]; then
error "Please specify a release archive and a config directory"
fi
@ -146,6 +150,7 @@ set_indent
info "Removing $e"
rm -rf "$TMPDIR/$e"
done
rm -rf "$TMPDIR/.git"
unset_indent
info "Extracting release archive"