aboutsummaryrefslogtreecommitdiff
path: root/src/hugo
diff options
context:
space:
mode:
authorSamruddhi Khandale <skhandale@microsoft.com>2022-06-13 23:30:57 +0300
committerGitHub <noreply@github.com>2022-06-13 23:30:57 +0300
commitfa07406f4dccd482284cb9d8dbaca6533116dab8 (patch)
tree438c8fd7b17b3d69ecede41ea0bdea99fe0e4eea /src/hugo
parent19fd66af965b22f57fd59a0ba31136146b9542d1 (diff)
add missing user groups to fix permission issues for non root user (#45)
* add missing user groups * fix username * move chmod: anaconda
Diffstat (limited to 'src/hugo')
-rw-r--r--src/hugo/install.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/hugo/install.sh b/src/hugo/install.sh
index 9e25aeb..11b2d6c 100644
--- a/src/hugo/install.sh
+++ b/src/hugo/install.sh
@@ -90,6 +90,11 @@ fi
# Install Hugo if it's missing
if ! hugo version &> /dev/null ; then
+ if ! cat /etc/group | grep -e "^hugo:" > /dev/null 2>&1; then
+ groupadd -r hugo
+ fi
+ usermod -a -G hugo "${USERNAME}"
+
echo "Installing Hugo..."
installation_dir="$HUGO_DIR/bin"
mkdir -p "$installation_dir"
@@ -108,6 +113,10 @@ if ! hugo version &> /dev/null ; then
rm "$hugo_filename"
updaterc "export HUGO_DIR=${installation_dir}"
+
+ chown -R :hugo "${HUGO_DIR}"
+ chmod -R g+r+w "${HUGO_DIR}"
+ find "${HUGO_DIR}" -type d | xargs -n 1 chmod g+s
fi
echo "Done!"