2022-01-15 17:31:05 +01:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
FFMPEG_INSTALL_DIR="/usr/lib/audiobookshelf-ffmpeg/"
|
|
|
|
ABS_BINARY_PATH="/usr/share/audiobookshelf/audiobookshelf"
|
|
|
|
|
|
|
|
remove_ffmpeg() {
|
2022-01-15 19:01:28 +01:00
|
|
|
if [[ -d "$FFMPEG_INSTALL_DIR" ]]
|
|
|
|
then
|
|
|
|
echo "Forcefully removing audiobookshelf-ffmpeg: $FFMPEG_INSTALL_DIR"
|
|
|
|
rm -r "$FFMPEG_INSTALL_DIR"
|
|
|
|
fi
|
2022-01-15 17:31:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
remove_binary() {
|
2022-01-15 19:01:28 +01:00
|
|
|
if [[ -f "$ABS_BINARY_PATH" ]]
|
|
|
|
then
|
|
|
|
echo "Removing audiobookshelf binary: $ABS_BINARY_PATH"
|
|
|
|
rm "$ABS_BINARY_PATH"
|
|
|
|
fi
|
2022-01-15 17:31:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
echo ">> Cleaning up"
|
2022-01-15 18:48:25 +01:00
|
|
|
remove_ffmpeg
|
|
|
|
remove_binary
|