diff --git a/bashrc.sh b/bashrc.sh index dd5ef5f..d15370e 100755 --- a/bashrc.sh +++ b/bashrc.sh @@ -357,15 +357,21 @@ alias prod-pull="pull_prod_backups" ## Root Workflows ## function go-root { - su + command="$1" + if [[ -z "$command" ]]; then + su + else + su -c "$command" + fi } +alias root="go-root " +alias doas-root="go-root " 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 { - go-root - cd "$plex_dir" + su -c "cd '$plex_dir'" } function pull-plex { dest="$1" @@ -373,9 +379,9 @@ function pull-plex { dest=/sdcard/Movies/ fi - go-root - cp -Rv "$plex_dir"/{1,2}/* "$dest" + su -c "cp -Rv '$plex_dir'/{1,2}/* '$dest'" } +alias get-plex="pull-plex" ## Finalize ##