mirror of
https://github.com/spritsail/plex-media-server.git
synced 2024-12-20 11:34:36 +00:00
Print clearer warning about permission change
This commit is contained in:
parent
9360ec8b65
commit
210576c0ea
19
entrypoint
19
entrypoint
@ -1,19 +1,25 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# ANSI colour escape sequences
|
||||||
|
RED='\033[0;31m'
|
||||||
|
RESET='\033[0m'
|
||||||
|
|
||||||
if su-exec -e [ ! -w "/config" ]; then
|
if su-exec -e [ ! -w "/config" ]; then
|
||||||
2>&1 echo "Warning: No permission to write in '/config' directory."
|
2>&1 echo -e "${RED}####################### WARNING #######################${RESET}"
|
||||||
2>&1 echo " Correcting permissions to prevent a crash"
|
|
||||||
2>&1 echo
|
2>&1 echo
|
||||||
(
|
2>&1 echo -e "${RED} No permission to write in '/config' directory.${RESET}"
|
||||||
set -x
|
2>&1 echo -e "${RED} Correcting permissions to prevent a crash.${RESET}"
|
||||||
|
2>&1 echo
|
||||||
|
2>&1 echo -e "${RED}#######################################################${RESET}"
|
||||||
|
|
||||||
chown $SUID:$SGID /config
|
chown $SUID:$SGID /config
|
||||||
chmod o+rw /config
|
chmod o+rw /config
|
||||||
)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec su-exec -e sh <<EOF
|
exec su-exec -e sh <<EOF
|
||||||
# Generate a default configuration, including some user-specified values
|
|
||||||
|
# Generate a default configuration on first run, including some user-specified values
|
||||||
if [ ! -e "/config/Preferences.xml" ]; then
|
if [ ! -e "/config/Preferences.xml" ]; then
|
||||||
gen-config.sh
|
gen-config.sh
|
||||||
fi
|
fi
|
||||||
@ -25,4 +31,5 @@ tail -Fn 0 "/config/Logs/Plex Media Server.log" 2>/dev/null &
|
|||||||
export PLEX_MEDIA_SERVER_PIDFILE="\$(mktemp -ut pms-pid.XXXXXX)"
|
export PLEX_MEDIA_SERVER_PIDFILE="\$(mktemp -ut pms-pid.XXXXXX)"
|
||||||
|
|
||||||
exec "\$PLEX_MEDIA_SERVER_HOME/Plex Media Server"
|
exec "\$PLEX_MEDIA_SERVER_HOME/Plex Media Server"
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
Loading…
Reference in New Issue
Block a user