adept/build/scripts/postinst
Gregory Ballantine e7fe6fbcec
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline failed
Updated post install script
2022-09-01 15:44:28 -04:00

25 lines
533 B
Bash
Executable File

#!/bin/sh
GETENT_USER=$(getent passwd adept)
GETENT_GROUP=$(getent group adept)
# Create the adept user if it doesn't already exist
if [ "$GETENT_USER" = "" ]; then
useradd -r adept
else
echo "The 'adept' user already exists, skipping creation."
fi
# Create the adept group if it doesn't already exist
if [ "$GETENT_GROUP" = "" ]; then
groupadd adept
usermod -aG adept adept
else
echo "The 'adept' group already exists, skipping creation."
fi
# Change the directory ownership of /etc
chown -R adept:adept /etc/adept
exit 0