Pietro0hz

Signed-off-by: pietro0hz <petros1111@gmail.com>
This commit is contained in:
pietro0hz
2024-10-31 21:09:23 +01:00
parent 18c6094e3f
commit c65d412091
6 changed files with 147 additions and 12 deletions

View File

@@ -289,17 +289,13 @@ if [ $UNIT_FILE = true ]; then
echo "[!] user ghost not found"
if prompt "[?] do you want to create ghost user? (NOT RECOMMENDED: current $(whoami))"; then
sudo useradd --system --create-home $user_name
if [ ! -d $BASE_PATH ]; then
echo "[+] create folder for the node at '$BASE_PATH'"
sudo mkdir $BASE_PATH
fi
else
user_name=$(whoami)
fi
fi
if [ ! -d $BASE_PATH ]; then
echo "[+] create folder for the node at '$BASE_PATH'"
sudo mkdir $BASE_PATH
fi
if [ -z "$(stat -c "%U %G" $BASE_PATH | grep $user_name)" ]; then
echo "[+] make $user_name owner of $BASE_PATH"
sudo chown -R "$user_name:" $BASE_PATH
fi