From 87a6614a6ce26d15553f79e34ea92232c0f87397 Mon Sep 17 00:00:00 2001 From: yuv420p10le <139547685+yuv420p10le@users.noreply.github.com> Date: Sat, 15 Jun 2024 00:04:05 +0300 Subject: [PATCH] Added uniq to folder name grabbing (#2) --- scripts/crack_docker.sh | 2 +- scripts/crack_native.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/crack_docker.sh b/scripts/crack_docker.sh index 5b59f49..111dcd6 100644 --- a/scripts/crack_docker.sh +++ b/scripts/crack_docker.sh @@ -5,7 +5,7 @@ PLEX_CONFIG_DIR=/config 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 echo "Run this script as root or through 'sudo'. Alternatively, add your user account to the 'docker' group. Script aborting." diff --git a/scripts/crack_native.sh b/scripts/crack_native.sh index 3a9df7b..2ec53f1 100644 --- a/scripts/crack_native.sh +++ b/scripts/crack_native.sh @@ -2,7 +2,7 @@ # 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 echo "Run this script as root or with sudo. Script aborting."