From d905cb1474a65eadbd5bdfbf674cd8df4140c0a1 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 15 Aug 2026 14:41:37 -0700 Subject: [PATCH] Change how the cd to Plex works since su just opens a new session and su -c closes the new session. Tried all combinations of -i -l -m -p with -c and none drop the user in a root shell after the command has been run. --- bashrc.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bashrc.sh b/bashrc.sh index d15370e..259263c 100755 --- a/bashrc.sh +++ b/bashrc.sh @@ -371,7 +371,13 @@ plex_dir='/data/user/0/com.plexapp.android/Plex Media Server/Sync/1' plex_movie_dir="$plex_dir"/1 plex_series_dir="$plex_dir"/2 function plex { - su -c "cd '$plex_dir'" + if [[ "$LOGNAME" == "root" ]]; then + cd "$plex_dir" + else + echo "Hopping into root, use this to go to plex's directory: " + echo "cd '$plex_dir'" + su + fi } function pull-plex { dest="$1"