mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-11-29 03:42:42 +01:00
Ensure Debian preinst creates and owns the data directory on reinstall
This commit is contained in:
1 parent
9ad14bd319
commit
f4204171a2
1 file changed
+7
-8
@@ -46,19 +46,18 @@ add_group() {
|
||||
}
|
||||
|
||||
setup_config() {
|
||||
if [ ! -d "$DEFAULT_DATA_DIR" ]; then
|
||||
# Create directory and set permissions
|
||||
echo "Creating default data dir at $DEFAULT_DATA_DIR"
|
||||
mkdir -p "$DEFAULT_DATA_DIR"
|
||||
fi
|
||||
chown 'audiobookshelf:audiobookshelf' "$DEFAULT_DATA_DIR"
|
||||
|
||||
if [ -f "$CONFIG_PATH" ]; then
|
||||
echo "Existing config found."
|
||||
cat $CONFIG_PATH
|
||||
|
||||
else
|
||||
|
||||
if [ ! -d "$DEFAULT_DATA_DIR" ]; then
|
||||
# Create directory and set permissions
|
||||
echo "Creating default data dir at $DEFAULT_DATA_DIR"
|
||||
mkdir "$DEFAULT_DATA_DIR"
|
||||
chown -R 'audiobookshelf:audiobookshelf' "$DEFAULT_DATA_DIR"
|
||||
fi
|
||||
|
||||
echo "Creating default config."
|
||||
|
||||
config_text="METADATA_PATH=$DEFAULT_DATA_DIR/metadata
|
||||
|
||||
Reference in new issue
Block a user