Skip to content

Commit

Permalink
create expected user if it doesn't exist
Browse files Browse the repository at this point in the history
in recent raspbian images pi user doesn't exist by default
  • Loading branch information
dernasherbrezon committed Sep 29, 2024
1 parent 04a21fb commit f821d0c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/main/deb/postinst
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
chmod 755 ${config.installDir}/lib/download.sh
${config.installDir}/lib/download.sh ${config.installDir}/lib/ /usr/share/java/r2cloud/

if id "${config.user}" &>/dev/null; then
echo "User '${config.user}' already exists."
else
useradd -m ${config.user}
echo "User '${config.user}' created."

if ! getent group ${config.group} > /dev/null; then
groupadd ${config.group}
echo "Group '${config.group}' created."
fi

usermod -aG dialout,plugdev ${config.user}
fi

chown -R ${config.user}:${config.group} ${config.installDir} /usr/share/java/r2cloud/*.jar
chmod 640 ${config.installDir}/lib/*.jar /usr/share/java/r2cloud/*.jar

Expand Down

0 comments on commit f821d0c

Please sign in to comment.