Skip to content

Commit

Permalink
add message if not executed with sudo
Browse files Browse the repository at this point in the history
  • Loading branch information
sinamics committed Oct 27, 2023
1 parent 7f1ac0f commit a425b0f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions install.ztnet/bash/ztnet.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/bash

# Check if the script is run as root (sudo)
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root (sudo). Exiting."
exit 1
fi

# exit if any command fails
set -e

Expand Down Expand Up @@ -72,6 +78,7 @@ if ! command_exists openssl; then
sudo apt install openssl -y
fi


# Remove directories and then recreate the target directory
rm -rf "$INSTALL_DIR" "$TARGET_DIR/.next" "$TARGET_DIR/prisma" "$TARGET_DIR/src"
mkdir -p "$TARGET_DIR"
Expand Down

0 comments on commit a425b0f

Please sign in to comment.