Added uniq to folder name grabbing (#2)

This commit is contained in:
yuv420p10le 2024-06-15 00:04:05 +03:00
parent f1efa3884f
commit 87a6614a6c
2 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@
PLEX_CONFIG_DIR=/config PLEX_CONFIG_DIR=/config
PLEX_CONTAINER_NAME=plex PLEX_CONTAINER_NAME=plex
PLEX_MEDIA_SERVER_DIR=$(ps aux | grep 'Plex Media Server' | grep -v grep | awk '{print $11}' | xargs dirname) PLEX_MEDIA_SERVER_DIR=$(ps aux | grep 'Plex Media Server' | grep -v grep | awk '{print $11}' | xargs dirname | uniq)
if [ `id -u` -ne 0 ] && ! groups $(whoami) | grep -q '\bdocker\b'; then if [ `id -u` -ne 0 ] && ! groups $(whoami) | grep -q '\bdocker\b'; then
echo "Run this script as root or through 'sudo'. Alternatively, add your user account to the 'docker' group. Script aborting." echo "Run this script as root or through 'sudo'. Alternatively, add your user account to the 'docker' group. Script aborting."

View File

@ -2,7 +2,7 @@
# The script assumes Plex Media Server is currently running. # The script assumes Plex Media Server is currently running.
PLEX_MEDIA_SERVER_DIR=$(ps aux | grep 'Plex Media Server' | grep -v grep | awk '{print $11}' | xargs dirname) PLEX_MEDIA_SERVER_DIR=$(ps aux | grep 'Plex Media Server' | grep -v grep | awk '{print $11}' | xargs dirname | uniq)
if [ `id -u` -ne 0 ]; then if [ `id -u` -ne 0 ]; then
echo "Run this script as root or with sudo. Script aborting." echo "Run this script as root or with sudo. Script aborting."