diff --git a/entrypoint b/entrypoint index 37175de..781810d 100755 --- a/entrypoint +++ b/entrypoint @@ -1,19 +1,25 @@ #!/bin/sh set -e +# ANSI colour escape sequences +RED='\033[0;31m' +RESET='\033[0m' + if su-exec -e [ ! -w "/config" ]; then - 2>&1 echo "Warning: No permission to write in '/config' directory." - 2>&1 echo " Correcting permissions to prevent a crash" + 2>&1 echo -e "${RED}####################### WARNING #######################${RESET}" 2>&1 echo - ( - set -x + 2>&1 echo -e "${RED} No permission to write in '/config' directory.${RESET}" + 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 chmod o+rw /config - ) fi exec su-exec -e sh </dev/null & export PLEX_MEDIA_SERVER_PIDFILE="\$(mktemp -ut pms-pid.XXXXXX)" exec "\$PLEX_MEDIA_SERVER_HOME/Plex Media Server" + EOF