Skip to content

Commit

Permalink
better installation scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
dernasherbrezon committed Sep 29, 2024
1 parent d4a7b0b commit b8c0111
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
25 changes: 16 additions & 9 deletions src/main/deb/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,26 @@ if id "${config.user}" &>/dev/null; then
else
useradd -m ${config.user}
echo "User '${config.user}' created."
fi

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

if ! getent group ${config.group} > /dev/null; then
groupadd ${config.group}
echo "Group '${config.group}' created."
fi
if [ $(getent group dialout) ]; then
usermod -a -G dialout ${config.user}
fi

usermod -aG dialout,plugdev ${config.user}
if [ $(getent group plugdev) ]; then
usermod -a -G plugdev ${config.user}
fi

if [ $(getent group systemd-journal) ]; then
usermod -a -G systemd-journal ${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 Expand Up @@ -58,10 +69,6 @@ if [ -f /etc/sudoers.d/nginx ]; then
chmod 440 /etc/sudoers.d/nginx
fi

if [ $(getent group systemd-journal) ]; then
usermod -a -G systemd-journal ${config.user}
fi

if [ ! -d /var/log/journal ]; then
echo "enable persistent journald logs"
mkdir -p /var/log/journal
Expand Down
2 changes: 1 addition & 1 deletion src/main/deb/prerm
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
echo "removing libs..."
rm ${config.installDir}/lib/*.jar
rm -f ${config.installDir}/lib/*.jar

0 comments on commit b8c0111

Please sign in to comment.