piframe/piframefleet/root/etc/cont-init.d/30-config

46 lines
1.2 KiB
Plaintext

#!/usr/bin/with-contenv bash
####################
# WireGuard
####################
if [ "$ENABLE_WIREGUARD" = true ] ; then
ip link del dev test 2>/dev/null
if ip link add dev test type wireguard; then
echo "**** It seems the wireguard module is already active :) ****"
ip link del dev test
else
echo "**** The wireguard module is not active, please install wireguard on the host and activate the 'wg' kernel module ****"
fi
fi
####################
# Pictures storage
####################
if [ ! -d "/opt/pictures" ]; then
mkdir /opt/pictures
fi
####################
# FileBrowser
####################
if [ "$ENABLE_FILEBROWSER" = true ] ; then
if [ ! -d "/opt/filebrowser" ]; then
mkdir /opt/filebrowser
fi
FB_DB="/opt/filebrowser/pictures.db"
if [ ! -f "$FB_DB" ]; then
echo "**** Initial FileBrowser Config ****"
filebrowser -d $FB_DB \
config init 2>&1 > /dev/null
filebrowser -d $FB_DB \
config set --address 0.0.0.0 2>&1 > /dev/null
filebrowser -d $FB_DB \
config set --port 9191 2>&1 > /dev/null
filebrowser -d $FB_DB \
config set --branding.name "PiFrameFleet - Pictures" 2>&1 > /dev/null
filebrowser -d $FB_DB \
users add admin password 2>&1 > /dev/null
fi
fi