|
|
@ -1,13 +1,18 @@ |
|
|
|
#!/bin/sh |
|
|
|
#!/bin/bash |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set -e |
|
|
|
|
|
|
|
|
|
|
|
mkdir -p $AIRSONIC_DIR/data/transcode |
|
|
|
mkdir -p $AIRSONIC_DIR/data/transcode |
|
|
|
ln -s /usr/bin/ffmpeg $AIRSONIC_DIR/data/transcode/ffmpeg |
|
|
|
ln -fs /usr/bin/ffmpeg $AIRSONIC_DIR/data/transcode/ffmpeg |
|
|
|
ln -s /usr/bin/lame $AIRSONIC_DIR/data/transcode/lame |
|
|
|
ln -fs /usr/bin/lame $AIRSONIC_DIR/data/transcode/lame |
|
|
|
|
|
|
|
|
|
|
|
chown -R $UID:$GID $AIRSONIC_DIR/data $AIRSONIC_DIR/playlists $AIRSONIC_DIR/podcasts |
|
|
|
if [[ $# -lt 1 ]] || [[ ! "$1" == "java"* ]]; then |
|
|
|
|
|
|
|
|
|
|
|
exec su-exec $UID:$GID tini -- \ |
|
|
|
java_opts_array=() |
|
|
|
java -Xmx256m \ |
|
|
|
while IFS= read -r -d '' item; do |
|
|
|
|
|
|
|
java_opts_array+=( "$item" ) |
|
|
|
|
|
|
|
done < <([[ $JAVA_OPTS ]] && xargs printf '%s\0' <<<"$JAVA_OPTS") |
|
|
|
|
|
|
|
exec java -Xmx256m \ |
|
|
|
-Dserver.host=0.0.0.0 \ |
|
|
|
-Dserver.host=0.0.0.0 \ |
|
|
|
-Dserver.port=$AIRSONIC_PORT \ |
|
|
|
-Dserver.port=$AIRSONIC_PORT \ |
|
|
|
-Dserver.contextPath=/ \ |
|
|
|
-Dserver.contextPath=/ \ |
|
|
@ -16,4 +21,8 @@ exec su-exec $UID:$GID tini -- \ |
|
|
|
-Dairsonic.defaultPodcastFolder=$AIRSONIC_DIR/podcasts \ |
|
|
|
-Dairsonic.defaultPodcastFolder=$AIRSONIC_DIR/podcasts \ |
|
|
|
-Dairsonic.defaultPlaylistFolder=$AIRSONIC_DIR/playlists \ |
|
|
|
-Dairsonic.defaultPlaylistFolder=$AIRSONIC_DIR/playlists \ |
|
|
|
-Djava.awt.headless=true \ |
|
|
|
-Djava.awt.headless=true \ |
|
|
|
-jar airsonic.war |
|
|
|
"${java_opts_array[@]}" \ |
|
|
|
|
|
|
|
-jar airsonic.war "$@" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exec "$@" |
|
|
|