From 06c7776b152464dce291c6378cceab007d474249 Mon Sep 17 00:00:00 2001 From: advplyr Date: Sat, 15 Jan 2022 12:01:28 -0600 Subject: [PATCH] Fix:Bash debian postrm script --- build/debian/DEBIAN/postrm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/build/debian/DEBIAN/postrm b/build/debian/DEBIAN/postrm index 821951ab..e63fafb7 100644 --- a/build/debian/DEBIAN/postrm +++ b/build/debian/DEBIAN/postrm @@ -6,13 +6,19 @@ FFMPEG_INSTALL_DIR="/usr/lib/audiobookshelf-ffmpeg/" ABS_BINARY_PATH="/usr/share/audiobookshelf/audiobookshelf" remove_ffmpeg() { - echo "Forcefully removing audiobookshelf-ffmpeg: $FFMPEG_INSTALL_DIR" - rm -rf "$FFMPEG_INSTALL_DIR" + if [[ -d "$FFMPEG_INSTALL_DIR" ]] + then + echo "Forcefully removing audiobookshelf-ffmpeg: $FFMPEG_INSTALL_DIR" + rm -r "$FFMPEG_INSTALL_DIR" + fi } remove_binary() { - echo "Removing audiobookshelf binary: $ABS_BINARY_PATH" - rm "$ABS_BINARY_PATH" + if [[ -f "$ABS_BINARY_PATH" ]] + then + echo "Removing audiobookshelf binary: $ABS_BINARY_PATH" + rm "$ABS_BINARY_PATH" + fi } echo ">> Cleaning up"