Compare commits

..
12 Commits
2 changed files with 61 additions and 2 deletions

No files matched your search

+60 -1
View File
@@ -127,9 +127,14 @@ export PROJECT_TERMUX="$HOME/.git-env-termux"
function test-termux { function test-termux {
if [[ -d "$PROJECT_TERMUX" ]]; then if [[ -d "$PROJECT_TERMUX" ]]; then
log "`date` - Updating '$PROJECT_TERMUX'.\n" log "`date` - Updating '$PROJECT_TERMUX'.\n"
echo " Switching to '$BRANCH'."
git -C "$PROJECT_TERMUX" switch "$BRANCH" git -C "$PROJECT_TERMUX" switch "$BRANCH"
echo " Pulling with submodules."
git -C "$PROJECT_TERMUX" pull --recurse-submodules || \ git -C "$PROJECT_TERMUX" pull --recurse-submodules || \
( echo "Failed to pull project, exiting." && return 1 ) ( echo "Failed to pull project, exiting." && return 1 )
# Something above is doing a 'D setup.sh', so ensure it gets recreated.
echo " Ensuring setup.sh exists."
git -C "$PROJECT_TERMUX" restore setup.sh
else else
log "`date` - Downloading '$PROJECT_TERMUX'.\n" log "`date` - Downloading '$PROJECT_TERMUX'.\n"
git clone https://git.hyperling.com/me/env-termux \ git clone https://git.hyperling.com/me/env-termux \
@@ -234,7 +239,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 +359,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! #
+1 -1
View File
@@ -42,7 +42,7 @@ fi
echo -e "\n`date` - Install & Updayte Crtical Software" echo -e "\n`date` - Install & Updayte Crtical Software"
pkg install -y \ pkg install -y \
openssh tsu vim htop git cronie man zip ncurses-utils \ openssh tsu vim htop git cronie man zip ncurses-utils which \
nmap traceroute wget rsync \ nmap traceroute wget rsync \
ffmpeg imagemagick \ ffmpeg imagemagick \
kotlin php nodejs python libllvm hugo kotlin php nodejs python libllvm hugo