Skip to content

Commit

Permalink
Genericize the post-install and post-uninstall scripts more accurately
Browse files Browse the repository at this point in the history
  • Loading branch information
savetheclocktower committed Jan 14, 2025
1 parent 590daee commit 14dfd05
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
4 changes: 2 additions & 2 deletions script/post-install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

FILESOURCE='/opt/${executable}/resources/${executable}.sh'
FILESOURCE='/opt/${sanitizedProductName}/resources/${executable}.sh'
FILEDEST='/usr/bin/${executable}'

if [ -f "$FILEDEST" ]
Expand All @@ -18,7 +18,7 @@ case $executable in
;;
esac

SYMLINK_TARGET='/opt/${executable}/resources/app/ppm/bin/${ppm_executable}'
SYMLINK_TARGET='/opt/${sanitizedProductName}/resources/app/ppm/bin/${ppm_executable}'
SYMLINK_PATH='/usr/bin/${ppm_executable}'

if [ -L "$SYMLINK_PATH" ]
Expand Down
13 changes: 11 additions & 2 deletions script/post-uninstall-rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,23 @@ if [ $1 -ge 1 ]; then
exit 0
fi

PULSAR_SCRIPT_PATH='/usr/bin/pulsar'
PULSAR_SCRIPT_PATH='/usr/bin/${executable}'

if [ -f "$PULSAR_SCRIPT_PATH" ]
then
rm "$PULSAR_SCRIPT_PATH"
fi

PPM_SYMLINK_PATH='/usr/bin/ppm'
case $executable in
pulsar-next)
ppm_executable=ppm-next
;;
*)
ppm_executable=ppm
;;
esac

PPM_SYMLINK_PATH='/usr/bin/${ppm_executable}'

if [ -L "$PPM_SYMLINK_PATH" ]
then
Expand Down
13 changes: 11 additions & 2 deletions script/post-uninstall.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
#!/bin/sh

PULSAR_SCRIPT_PATH='/usr/bin/pulsar'
PULSAR_SCRIPT_PATH='/usr/bin/${executable}'

if [ -f "$PULSAR_SCRIPT_PATH" ]
then
rm "$PULSAR_SCRIPT_PATH"
fi

PPM_SYMLINK_PATH='/usr/bin/ppm'
case $executable in
pulsar-next)
ppm_executable=ppm-next
;;
*)
ppm_executable=ppm
;;
esac

PPM_SYMLINK_PATH='/usr/bin/${ppm_executable}'

if [ -L "$PPM_SYMLINK_PATH" ]
then
Expand Down

0 comments on commit 14dfd05

Please sign in to comment.