Compare commits

..
9 Commits
+55 -1
View File
@@ -234,7 +234,7 @@ alias goodbye="update -y && bye"
## Video Related ## ## Video Related ##
alias pull-content="mv -v $SS/DCIM/Camera/`date +"%Y-%m-%d"`* ./raw/" alias pull-content="mv -v $SS/DCIM/Camera/`date +"%Y-%m-%d"`* $SS/DCIM/OpenCamera/`date +"%Y%m%d"`* ./raw/"
alias pull-screenshots="mv -v $SS/Pictures/Screenshots/*`date +"%Y%m%d"`* ./raw/" alias pull-screenshots="mv -v $SS/Pictures/Screenshots/*`date +"%Y%m%d"`* ./raw/"
alias pull-screenshot="pull-screenshots" alias pull-screenshot="pull-screenshots"
@@ -354,6 +354,60 @@ alias pull-prod="pull_prod_backups"
alias prod-pull="pull_prod_backups" alias prod-pull="pull_prod_backups"
## Root Workflows ##
function go-root {
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 {
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"
if [[ -z "$dest" ]]; then
dest=/sdcard/Movies/
fi
su -c "cp -Rv '$plex_dir'/{1,2}/* '$dest'"
cd "$dest"
ls | while read dir; do
echo "Checking '$dir'"
cd "$dir"
ls -lh
# Unsure why -e and -f don't work here. Spaces in filenames? Globs?
if [[ `ls *.chunk0 2>/dev/null` ]]; then
final="movie.mkv"
echo "Catting files together to make '$final'."
cat *.chunk* > $final
ls -lh $final
rm -v *.chunk*
fi
cd ..
done
}
alias get-plex="pull-plex"
## Finalize ## ## Finalize ##
# Export all functions! # # Export all functions! #