mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
Change:Debian packager post install and post remove
This commit is contained in:
parent
5280ab222b
commit
0335da4477
@ -2,6 +2,8 @@
|
|||||||
set -e
|
set -e
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
FFMPEG_INSTALL_DIR="/usr/lib/audiobookshelf-ffmpeg/"
|
||||||
|
|
||||||
declare -r init_type='auto'
|
declare -r init_type='auto'
|
||||||
declare -ri no_rebuild='0'
|
declare -ri no_rebuild='0'
|
||||||
|
|
||||||
@ -81,5 +83,6 @@ add_user 'audiobookshelf' '' 'audiobookshelf' 'audiobookshelf user-daemon' '/bin
|
|||||||
mkdir -p '/var/log/audiobookshelf'
|
mkdir -p '/var/log/audiobookshelf'
|
||||||
chown -R 'audiobookshelf:audiobookshelf' '/var/log/audiobookshelf'
|
chown -R 'audiobookshelf:audiobookshelf' '/var/log/audiobookshelf'
|
||||||
chown -R 'audiobookshelf:audiobookshelf' '/usr/share/audiobookshelf'
|
chown -R 'audiobookshelf:audiobookshelf' '/usr/share/audiobookshelf'
|
||||||
|
chown -R 'audiobookshelf:audiobookshelf' "$FFMPEG_INSTALL_DIR"
|
||||||
|
|
||||||
start_service 'audiobookshelf'
|
start_service 'audiobookshelf'
|
||||||
|
20
build/debian/DEBIAN/postrm
Normal file
20
build/debian/DEBIAN/postrm
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_binary() {
|
||||||
|
echo "Removing audiobookshelf binary: $ABS_BINARY_PATH"
|
||||||
|
rm "$ABS_BINARY_PATH"
|
||||||
|
}
|
||||||
|
|
||||||
|
echo ">> Cleaning up"
|
||||||
|
remove_ffmpeg()
|
||||||
|
remove_binary()
|
@ -2,6 +2,7 @@
|
|||||||
set -e
|
set -e
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
FFMPEG_INSTALL_DIR="/usr/lib/audiobookshelf-ffmpeg/"
|
||||||
DEFAULT_AUDIOBOOK_PATH="/usr/share/audiobookshelf/audiobooks"
|
DEFAULT_AUDIOBOOK_PATH="/usr/share/audiobookshelf/audiobooks"
|
||||||
DEFAULT_DATA_PATH="/usr/share/audiobookshelf"
|
DEFAULT_DATA_PATH="/usr/share/audiobookshelf"
|
||||||
DEFAULT_PORT=7331
|
DEFAULT_PORT=7331
|
||||||
@ -12,20 +13,17 @@ install_ffmpeg() {
|
|||||||
echo "Starting FFMPEG Install"
|
echo "Starting FFMPEG Install"
|
||||||
|
|
||||||
WGET="wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz"
|
WGET="wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz"
|
||||||
TARGET_DIR="/usr/lib/audiobookshelf-ffmpeg/"
|
|
||||||
|
|
||||||
if ! cd "$TARGET_DIR"; then
|
if ! cd "$FFMPEG_INSTALL_DIR"; then
|
||||||
echo "WARNING: can't access working directory ($TARGET_DIR) creating it" >&2
|
echo "WARNING: can't access working directory ($FFMPEG_INSTALL_DIR) creating it" >&2
|
||||||
mkdir "$TARGET_DIR"
|
mkdir "$FFMPEG_INSTALL_DIR"
|
||||||
cd "$TARGET_DIR"
|
cd "$FFMPEG_INSTALL_DIR"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$WGET
|
$WGET
|
||||||
tar xvf ffmpeg-git-amd64-static.tar.xz --strip-components=1
|
tar xvf ffmpeg-git-amd64-static.tar.xz --strip-components=1
|
||||||
rm ffmpeg-git-amd64-static.tar.xz
|
rm ffmpeg-git-amd64-static.tar.xz
|
||||||
|
|
||||||
chown -R 'audiobookshelf:audiobookshelf' "$TARGET_DIR"
|
|
||||||
|
|
||||||
echo "Good to go on Ffmpeg... hopefully"
|
echo "Good to go on Ffmpeg... hopefully"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user