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.

This commit is contained in:
me
2026-08-15 14:41:37 -07:00
parent eedc765074
commit d905cb1474
+7 -1
View File
@@ -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"