Compare commits
47 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7237184456 | |||
| ee651659aa | |||
| aa5a6e7b77 | |||
| 0485f27205 | |||
| f811070949 | |||
| 1e3f6a7402 | |||
| 37db32a78b | |||
| 40af484ddd | |||
| fa98b50827 | |||
| 7f9494411b | |||
| 1957f4fdab | |||
| 14d8a61f49 | |||
| 07ca207fd1 | |||
| 0494b05bb7 | |||
| 55102cc9fd | |||
| 4d740d7d2f | |||
| 080669359a | |||
| 4cfeb6073c | |||
| 74bdd45ef7 | |||
| 98fc25a132 | |||
| a0962cb04d | |||
| e85947cb0c | |||
| 3c285298eb | |||
| a9c9f3b784 | |||
| 53fbb829a3 | |||
| 28219c97ed | |||
| 876a106ea0 | |||
| 3554a40622 | |||
| b0fcdb9429 | |||
| 0a26a3b3e8 | |||
| 663079c0cd | |||
| 33c60504bd | |||
| a5791e2bc6 | |||
| 3763fc6000 | |||
| 49d9c95c85 | |||
| 6220e70480 | |||
| 2324acb6d6 | |||
| e27924f062 | |||
| d3dc527b26 | |||
| 7ceb1f436b | |||
| 8ef92669cd | |||
| d793218215 | |||
| bb0bcc27c8 | |||
| bdd7e7855b | |||
| 060a3b25d8 | |||
| 6b3975176a | |||
| 67ef7d128f |
@@ -7,7 +7,7 @@ Hyperling's scripts for a productive Termux environment.
|
|||||||
1. Download the repository.
|
1. Download the repository.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone https://github.com/Hyperling/Termux termux
|
git clone https://git.hyperling.com/me/env-termux env-termux
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Dive into the directory.
|
1. Dive into the directory.
|
||||||
|
|||||||
321
bashrc.sh
321
bashrc.sh
@@ -17,14 +17,28 @@ fi
|
|||||||
# Quickies
|
# Quickies
|
||||||
alias reload-bash="source ~/.bashrc"
|
alias reload-bash="source ~/.bashrc"
|
||||||
alias bash-reload="reload-bash"
|
alias bash-reload="reload-bash"
|
||||||
|
alias shell-reload="reload-bash"
|
||||||
|
alias reload-shell="reload-bash"
|
||||||
alias reload="reload-bash"
|
alias reload="reload-bash"
|
||||||
|
|
||||||
|
alias l='ls'
|
||||||
|
alias ll='ls -alh'
|
||||||
|
alias lh='ls -ash'
|
||||||
|
|
||||||
|
alias clone="rsync -auPhz --delete --exclude '.gradle' --exclude 'app/build'"
|
||||||
|
|
||||||
# Easily get to storage devices.
|
# Easily get to storage devices.
|
||||||
export SS="~/storage/shared"
|
curr="`pwd`"
|
||||||
|
cd
|
||||||
|
cd storage/shared
|
||||||
|
#export SS="`pwd`"
|
||||||
|
export SS="/sdcard"
|
||||||
|
cd
|
||||||
alias ss="cd $SS"
|
alias ss="cd $SS"
|
||||||
alias sd="ss"
|
alias sd="ss"
|
||||||
alias storage="ss"
|
alias storage="ss"
|
||||||
alias home="ss"
|
alias home="ss"
|
||||||
|
cd "$curr"
|
||||||
|
|
||||||
# Shortcut to media.
|
# Shortcut to media.
|
||||||
export DCIM="$SS/DCIM/Camera"
|
export DCIM="$SS/DCIM/Camera"
|
||||||
@@ -37,29 +51,187 @@ alias code="cd $CODE"
|
|||||||
# Shortcuts for TRASH.
|
# Shortcuts for TRASH.
|
||||||
export TRASH="$SS/TRASH"
|
export TRASH="$SS/TRASH"
|
||||||
alias trash="cd $TRASH"
|
alias trash="cd $TRASH"
|
||||||
alias clean-trash="bash -c 'rm -rfv $TRASH/*'"
|
alias clean-trash="bash -c 'rm -rfv $TRASH/*'; clean-trashed"
|
||||||
alias trash-clean="clean-trash"
|
alias trash-clean="clean-trash"
|
||||||
alias check-trash="du -h $TRASH"
|
alias check-trash="du -h $TRASH"
|
||||||
alias trash-check="check-trash"
|
alias trash-check="check-trash"
|
||||||
|
|
||||||
|
alias clean-trashed='find "$SS" -name ".trashed*" -exec du -h {} \; -delete | sort -h'
|
||||||
|
alias check-trashed='find "$SS" -name ".trashed*" -exec du -h {} \; -exec mv -v {} ~/TRASH/ \; | sort -h'
|
||||||
|
|
||||||
# Help prevent mistakes.
|
# Help prevent mistakes.
|
||||||
alias cp="cp -v"
|
alias cp="cp -v"
|
||||||
alias mv="mv -v"
|
alias mv="mv -v"
|
||||||
alias rm="echo 'Move to ~/storage/shared/TRASH/ instead!'"
|
alias rm="echo 'Move to ~/storage/shared/TRASH/ instead!'"
|
||||||
|
|
||||||
# Quickies
|
# Quickies
|
||||||
alias update="pkg update && pkg upgrade"
|
|
||||||
alias bye="exit"
|
alias bye="exit"
|
||||||
alias goodbye="update -y && bye"
|
|
||||||
alias install="pkg install"
|
alias install="pkg install"
|
||||||
|
alias uninstall="pkg uninstall"
|
||||||
|
alias remove="uninstall"
|
||||||
|
alias scan="nmap -A -p- --script=vuln"
|
||||||
|
|
||||||
## Functions ##
|
|
||||||
|
### Functions ###
|
||||||
|
|
||||||
|
## Code Related ##
|
||||||
|
|
||||||
|
function code-projects {
|
||||||
|
cat <<- EOF
|
||||||
|
env-termux dev
|
||||||
|
env-ansible dev
|
||||||
|
env-docker dev
|
||||||
|
nodejs-website dev
|
||||||
|
hugo-jackanope main
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
function code-reseed {
|
||||||
|
cd ~/Code
|
||||||
|
code-projects | while read project branch; do
|
||||||
|
git clone ssh://git@$GIT_SERVER:$GIT_PORT/$GIT_USER/$project --branch $branch --recurse-submodules
|
||||||
|
done
|
||||||
|
}
|
||||||
|
alias reseed-code="code-reseed"
|
||||||
|
|
||||||
|
function check-code {
|
||||||
|
cd ~/Code
|
||||||
|
ls | while read project; do
|
||||||
|
echo -e "\nChecking $project..."
|
||||||
|
cd $project
|
||||||
|
if [[ -d .git ]]; then
|
||||||
|
git pull
|
||||||
|
git push
|
||||||
|
else
|
||||||
|
echo "* Not a valid git project, skipping."
|
||||||
|
fi
|
||||||
|
cd ..
|
||||||
|
done
|
||||||
|
}
|
||||||
|
alias code-check="check-code"
|
||||||
|
|
||||||
|
# Quickly commit code to a repo.
|
||||||
|
function commit {
|
||||||
|
message="$1"
|
||||||
|
if [[ -z "$message" ]]; then
|
||||||
|
echo "ERROR: A message is required." >&2
|
||||||
|
echo 'USAGE: commit "My commit message."' >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [[ "$1" == "-m" ]]; then
|
||||||
|
message="$2"
|
||||||
|
fi
|
||||||
|
git add . && git commit -m "$message" && git push
|
||||||
|
}
|
||||||
|
|
||||||
|
# Easily test this project after committing changes.
|
||||||
|
# Otherwise can just source this file unless testing setup.sh.
|
||||||
|
function test-termux {
|
||||||
|
sh -c "rm -rf ~/termux-deleteme ~/TRASH/termux-deleteme" 2>/dev/null
|
||||||
|
git clone https://git.hyperling.com/me/env-termux \
|
||||||
|
--branch=dev ~/termux-deleteme
|
||||||
|
chmod 755 ~/termux-deleteme/*.sh
|
||||||
|
~/termux-deleteme/setup.sh
|
||||||
|
}
|
||||||
|
alias reload-termux="test-termux"
|
||||||
|
alias termux-test="test-termux"
|
||||||
|
alias termux-reload="reload-termux"
|
||||||
|
|
||||||
|
|
||||||
|
# Pulled from /me/env-ansible, need to make a shared library between it and Termux.
|
||||||
|
# Change a branch to point at another.
|
||||||
|
function load-branch {
|
||||||
|
rcvr="$1" # branch which we want to modify
|
||||||
|
base="$2" # branch with the changes we want
|
||||||
|
|
||||||
|
if [[ "$rcvr" == "main" ]]; then
|
||||||
|
echo "*** ERROR: Are you nuts, fool!? Not main! Do it manually! ***"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$base" ]]; then
|
||||||
|
if [[ "$rcvr" == "prod" ]]; then
|
||||||
|
base="stage"
|
||||||
|
elif [[ "$rcvr" == "stage" ]]; then
|
||||||
|
base="dev"
|
||||||
|
else
|
||||||
|
echo "* Unsure which branch to use for '$rcvr'. Please specify."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
echo "* Base was not specified, using '$base' for '$rcvr'."
|
||||||
|
else
|
||||||
|
echo "* Requested pointing '$rcvr' branch to '$base'."
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "\n* Ensuring we are on base branch '$base'." &&
|
||||||
|
git switch "$base" &&
|
||||||
|
echo -e "\n* Changing pointer for '$rcvr' to '$base'." &&
|
||||||
|
git branch -f "$rcvr" "$base" &&
|
||||||
|
#echo -e "\n* Switching to branch '$rcvr'." &&
|
||||||
|
#git switch "$rcvr" &&
|
||||||
|
echo -e "\n* Forcing push on branch '$rcvr'." &&
|
||||||
|
git push --force --set-upstream origin "$rcvr" &&
|
||||||
|
echo -e "\n* Done! Displaying list of remote branches." &&
|
||||||
|
git ls-remote --heads | sort
|
||||||
|
|
||||||
|
if [[ "$base" != "dev" ]]; then
|
||||||
|
echo -e "\n* Checking if a dev branch exists."
|
||||||
|
git ls-remote --exit-code --heads origin dev
|
||||||
|
dev_exists="$?"
|
||||||
|
if [[ "$dev_exists" == 0 ]]; then
|
||||||
|
echo -e "\n* Switching back to dev."
|
||||||
|
git switch dev
|
||||||
|
elif [[ "$dev_exists" == 2 ]]; then
|
||||||
|
echo -e "\n* Switching back to main."
|
||||||
|
git switch main
|
||||||
|
else
|
||||||
|
echo "*** ERROR: Unknown status for dev_exists, '$dev_exists'. ***"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "\n* Verifying which branch we're on."
|
||||||
|
git branch
|
||||||
|
}
|
||||||
|
alias load-prod="load-branch prod"
|
||||||
|
alias load-stage="load-branch stage"
|
||||||
|
alias rollback-prod="load-branch prod main"
|
||||||
|
alias rollback-stage="load-branch stage prod"
|
||||||
|
alias rollback-dev="load-branch dev stage"
|
||||||
|
alias reset-prod="load-branch prod main"
|
||||||
|
alias reset-stage="load-branch stage main"
|
||||||
|
alias reset-dev="load-branch dev main"
|
||||||
|
|
||||||
|
|
||||||
|
## Termux Related ##
|
||||||
|
|
||||||
|
function update {
|
||||||
|
params="$1"
|
||||||
|
|
||||||
|
echo "******* Apt / Pkg *******" &&
|
||||||
|
echo "*** Update Cache ***" &&
|
||||||
|
apt update &&
|
||||||
|
echo -e "\n*** Auto Remove ***" &&
|
||||||
|
apt autoremove $params &&
|
||||||
|
echo -e "\n*** Clean ***" &&
|
||||||
|
pkg clean $params &&
|
||||||
|
echo -e "Cleaned!\n\n*** Fix Broken/Missing ***" &&
|
||||||
|
apt --fix-broken --fix-missing install &&
|
||||||
|
echo -e "\n*** Upgrade ***" &&
|
||||||
|
# No longer using `apt`, in favor of Termux's wrapper `pkg`.
|
||||||
|
#apt dist-upgrade --allow-downgrades --fix-broken --fix-missing $params &&
|
||||||
|
pkg upgrade $params
|
||||||
|
echo -e "\n******* Mission Complete!! *******"
|
||||||
|
}
|
||||||
|
alias upgrade="update"
|
||||||
|
alias goodbye="update -y && bye"
|
||||||
|
|
||||||
|
|
||||||
|
## Videk Related ##
|
||||||
|
|
||||||
# Optimize the bitrate and audio levels for an edited video.
|
# Optimize the bitrate and audio levels for an edited video.
|
||||||
function process-video-usage {
|
function process-video-usage {
|
||||||
echo "USAGE: process-video oldFile newFile [videoBitrate] [audioBitrate] [sizeRating]"
|
echo "USAGE: process-video oldFile newFile [videoBitrate] [audioBitrate] [sizeRating] [numPasses] [forceBitrate]"
|
||||||
echo -n "Purpose: Call ffmpeg with preferred video posting settings. "
|
echo -n "Purpose: Call ffmpeg with preferred video posting settings. "
|
||||||
echo -n "Bitrates default to 2000k and 192k, size is 720. "
|
echo -n "Bitrates default to 2000k and 192k, size is 720, passes is 1, and force is N."
|
||||||
echo "These work well on Odysee and are fairly small as backups."
|
echo "These work well on Odysee and are fairly small as backups."
|
||||||
echo "Examples:"
|
echo "Examples:"
|
||||||
echo "- Create a small file for quick streaming."
|
echo "- Create a small file for quick streaming."
|
||||||
@@ -75,6 +247,7 @@ function process-video {
|
|||||||
audio="$4"
|
audio="$4"
|
||||||
size="$5"
|
size="$5"
|
||||||
passes="$6"
|
passes="$6"
|
||||||
|
force="$7"
|
||||||
|
|
||||||
# Validations
|
# Validations
|
||||||
if [[ -z $file || ! -e $file ]]; then
|
if [[ -z $file || ! -e $file ]]; then
|
||||||
@@ -99,7 +272,11 @@ function process-video {
|
|||||||
if [[ -z $video ]]; then
|
if [[ -z $video ]]; then
|
||||||
video="2000k"
|
video="2000k"
|
||||||
fi
|
fi
|
||||||
video="-maxrate $video"
|
if [[ $force == "Y" ]]; then
|
||||||
|
video="-b:v $video"
|
||||||
|
else
|
||||||
|
video="-b:v $video -minrate 0 -maxrate $video -bufsize $video"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -z $audio ]]; then
|
if [[ -z $audio ]]; then
|
||||||
audio="192k"
|
audio="192k"
|
||||||
@@ -168,29 +345,7 @@ function process-video {
|
|||||||
return $status
|
return $status
|
||||||
}
|
}
|
||||||
alias pv="process-video"
|
alias pv="process-video"
|
||||||
|
alias qpv="pv ./raw/YouCut*.mp4 $(basename `pwd`).mp4"
|
||||||
# Quickly commit code to a repo.
|
|
||||||
function commit {
|
|
||||||
message="$1"
|
|
||||||
if [[ -z $message ]]; then
|
|
||||||
echo "ERROR: A message is required." >&2
|
|
||||||
echo 'USAGE: commit "My commit message."' >&2
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
git add . && git commit -m "$message" && git push
|
|
||||||
}
|
|
||||||
|
|
||||||
# Easily test this project after committing changes.
|
|
||||||
# Otherwise can just source this file unless testing setup.sh.
|
|
||||||
function test-termux {
|
|
||||||
sh -c "rm -rf ~/termux-deleteme ~/TRASH/termux-deleteme" 2>/dev/null
|
|
||||||
git clone https://github.com/Hyperling/Termux ~/termux-deleteme --branch=dev
|
|
||||||
chmod 755 ~/termux-deleteme/*.sh
|
|
||||||
~/termux-deleteme/setup.sh
|
|
||||||
}
|
|
||||||
alias reload-termux="test-termux"
|
|
||||||
alias termux-test="test-termux"
|
|
||||||
alias termux-reload="reload-termux"
|
|
||||||
|
|
||||||
# Allow converting video to audio ad other smaller
|
# Allow converting video to audio ad other smaller
|
||||||
# tasks than what process-video is intended to do.
|
# tasks than what process-video is intended to do.
|
||||||
@@ -292,8 +447,108 @@ alias vta="v2a"
|
|||||||
alias va="v2a"
|
alias va="v2a"
|
||||||
alias pa="v2a"
|
alias pa="v2a"
|
||||||
|
|
||||||
# Go to normal storage. DISABLED, use shortcut aliases instead.
|
alias pull-content="mv -v $SS/DCIM/Camera/`date +"%Y-%m-%d"`* ./raw/"
|
||||||
#cd ~/storage/shared/
|
|
||||||
|
|
||||||
|
alias pull-screenshots="mv -v $SS/Pictures/Screenshots/* ./raw/"
|
||||||
|
alias pull-screenshot="pull-screenshots"
|
||||||
|
alias pull-sc="pull-screenshots"
|
||||||
|
|
||||||
|
alias pull-crops="mv -v $SS/Documents/*/`date +"%Y%m%d"`*.{jpg,png} ./raw/"
|
||||||
|
|
||||||
|
alias pull-youcuts="mv -v $SS/Movies/youcut/* ./raw/"
|
||||||
|
alias pull-youcut="pull-youcuts"
|
||||||
|
alias pull-yc="pull-youcut"
|
||||||
|
|
||||||
|
alias pull-memes="mv -v $SS/Pictures/memetastic/memes/*.jpg ./"
|
||||||
|
alias pull-meme="pull-memes"
|
||||||
|
alias pull-icon="pull-meme"
|
||||||
|
|
||||||
|
|
||||||
|
function init-video-contents {
|
||||||
|
if [[ -n "$1" ]]; then
|
||||||
|
mkdir "$1"
|
||||||
|
cd "$1"
|
||||||
|
fi
|
||||||
|
touch README.md
|
||||||
|
#touch title.md
|
||||||
|
#touch desc.md
|
||||||
|
#touch tags.md
|
||||||
|
mkdir -pv raw
|
||||||
|
}
|
||||||
|
alias init-video="init-video-contents"
|
||||||
|
alias init-vid="init-video"
|
||||||
|
alias initvid="init-vid"
|
||||||
|
|
||||||
|
alias mkvid="init-video; pull-content; pull-yc; pull-sc; pull-crops; pull-icon; qpv"
|
||||||
|
alias mkv="mkvid"
|
||||||
|
alias qvd="mkv"
|
||||||
|
alias qv="qvd"
|
||||||
|
|
||||||
|
## End Video Section ##
|
||||||
|
|
||||||
|
|
||||||
|
## Backup Related ##
|
||||||
|
|
||||||
|
function now {
|
||||||
|
date "+%Y%m%d-%H%M%S"
|
||||||
|
}
|
||||||
|
function today {
|
||||||
|
date "+%Y%m%d"
|
||||||
|
}
|
||||||
|
export BACKUP_DIR="/srv/backup"
|
||||||
|
export DOCKER="Docker"
|
||||||
|
export SYSTEM="System"
|
||||||
|
function pull_prod_backup {
|
||||||
|
if [[ -z "$1" || ("$1" != "$DOCKER" && "$1" != "$SYSTEM") ]]; then
|
||||||
|
echo "ERROR: Parameter 1 not correct, expecting '$DOCKER' or '$SYSTEM'."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
backup_type="$1"
|
||||||
|
echo "Looking for '*${backup_type}*.zip'"
|
||||||
|
ls -lh *${backup_type}*.zip 2>/dev/null
|
||||||
|
status="$?"
|
||||||
|
if [[ "$status" == "0" ]]; then
|
||||||
|
echo "File already downloaded, skipping."
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
echo "File still needed, downloading to local tmp/."
|
||||||
|
fi
|
||||||
|
mkdir -pv tmp
|
||||||
|
scp -P $PROD_PORT \
|
||||||
|
$PROD_USER@$PROD_NAME:"$BACKUP_DIR/*${backup_type}*.zip" \
|
||||||
|
tmp/
|
||||||
|
if [[ "$?" == "0" ]]; then
|
||||||
|
echo "Succeeded!"
|
||||||
|
mv -v tmp/*.zip ./
|
||||||
|
rmdir -v tmp
|
||||||
|
else
|
||||||
|
echo "Failed!"
|
||||||
|
mv tmp "$TRASH/tmp_`now`"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
function pull_prod_backups {
|
||||||
|
dir="ProductionBackups-Pulled`today`"
|
||||||
|
mkdir -pv "$dir"
|
||||||
|
cd "$dir"
|
||||||
|
pull_prod_backup "$DOCKER"
|
||||||
|
pull_prod_backup "$SYSTEM"
|
||||||
|
du -h *.zip | sort -h
|
||||||
|
status="$?"
|
||||||
|
cd ..
|
||||||
|
if [[ "$status" != 0 ]]; then
|
||||||
|
echo "Failed to find zip files, removing folder."
|
||||||
|
rmdir -v "$dir"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
echo "Done!"
|
||||||
|
}
|
||||||
|
alias pull-prod-backups="pull_prod_backups"
|
||||||
|
alias pull-backups="pull_prod_backups"
|
||||||
|
alias prod-backups="pull_prod_backups"
|
||||||
|
alias prod-backup="pull_prod_backups"
|
||||||
|
alias pull-prod="pull_prod_backups"
|
||||||
|
alias prod-pull="pull_prod_backups"
|
||||||
|
|
||||||
|
# Complete!
|
||||||
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
||||||
echo "'$PROG' completed!"
|
echo "'$PROG' completed!"
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
# 2024-02-10 Hyperling
|
|
||||||
|
|
||||||
# Variables for a fast-access SSH alias.
|
|
||||||
PROD_USER=username
|
|
||||||
PROD_NAME=example.com
|
|
||||||
PROD_PORT=2222
|
|
||||||
|
|
||||||
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
|
||||||
echo "'$PROG' completed!"
|
|
||||||
42
setup.sh
42
setup.sh
@@ -9,11 +9,16 @@ cd $DIR
|
|||||||
DIR="`pwd`"
|
DIR="`pwd`"
|
||||||
echo "Working in '$DIR'."
|
echo "Working in '$DIR'."
|
||||||
|
|
||||||
echo -e "\n`date` - Upgrade Package Repos"
|
if [[ $1 == "skip" ]]; then
|
||||||
pkg update &&
|
echo "\n`date` - Skipping Updates"
|
||||||
pkg upgrade -y
|
else
|
||||||
|
echo -e "\n`date` - Upgrade Package Repos"
|
||||||
|
pkg update &&
|
||||||
|
pkg upgrade -y
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e "\n`date` - Check Storage Permission"
|
echo -e "\n`date` - Check Storage Permission"
|
||||||
|
|
||||||
if [[ ! -e ~/storage/shared ]]; then
|
if [[ ! -e ~/storage/shared ]]; then
|
||||||
sleep 3
|
sleep 3
|
||||||
termux-setup-storage
|
termux-setup-storage
|
||||||
@@ -27,19 +32,24 @@ else
|
|||||||
echo "Everything looks good already, pal."
|
echo "Everything looks good already, pal."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "\n`date` - Install Software"
|
if [[ $1 == "skip" ]]; then
|
||||||
pkg install -y \
|
echo "\n`date` - Skipping Installs"
|
||||||
openssh tsu vim htop git cronie man \
|
else
|
||||||
nmap traceroute wget \
|
echo -e "\n`date` - Install Software"
|
||||||
ffmpeg imagemagick \
|
pkg install -y \
|
||||||
kotlin php nodejs python libllvm
|
openssh tsu vim htop git cronie man zip \
|
||||||
|
nmap traceroute wget rsync \
|
||||||
|
ffmpeg imagemagick \
|
||||||
|
kotlin php nodejs python libllvm hugo
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e "\n`date` - BASH Environment"
|
echo -e "\n`date` - BASH Environment"
|
||||||
|
|
||||||
if [[ ! -e ~/.env ]]; then
|
if [[ ! -e ~/.env ]]; then
|
||||||
if [[ -e env.example ]]; then
|
if [[ -e env.example ]]; then
|
||||||
mv -v env.example ~/.env
|
mv -v env.example ~/.env
|
||||||
else
|
else
|
||||||
echo "ERROR: Neither .env or env.example found." >&2
|
echo "ERROR: Neither .env or env.example found." >&2
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "'.env' already exists. Good job!"
|
echo "'.env' already exists. Good job!"
|
||||||
@@ -52,7 +62,8 @@ else
|
|||||||
echo "ERROR: bashrc.sh not found, skipping." >&2
|
echo "ERROR: bashrc.sh not found, skipping." >&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "\n`date` - Cleanup"
|
echo -e "\n`date` - Directoriee"
|
||||||
|
|
||||||
if [[ -d ~/TRASH ]]; then
|
if [[ -d ~/TRASH ]]; then
|
||||||
rm -rfv ~/TRASH
|
rm -rfv ~/TRASH
|
||||||
fi
|
fi
|
||||||
@@ -61,7 +72,14 @@ if [[ ! -e ~/storage/shared/TRASH ]]; then
|
|||||||
fi
|
fi
|
||||||
ln -s ~/storage/shared/TRASH ~/TRASH
|
ln -s ~/storage/shared/TRASH ~/TRASH
|
||||||
|
|
||||||
if [[ -n $DIR && $DIR != "/" && -d .git ]]; then
|
if [[ ! -d ~/Code && ! -d ~/storage/shared/Code ]]; then
|
||||||
|
mkdir -pv ~/Code
|
||||||
|
ln -s ~/Code ~/storage/shared/Code
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "\n`date` - Cleanup"
|
||||||
|
|
||||||
|
if [[ -n $DIR && $DIR != "/" && $DIR == *"deleteme" && -d .git ]]; then
|
||||||
echo "We are in a git clone, remove the project."
|
echo "We are in a git clone, remove the project."
|
||||||
cd ..
|
cd ..
|
||||||
mv -v $DIR ~/TRASH/termux-"`date +'%Y%m%d%H%M%S'`" |
|
mv -v $DIR ~/TRASH/termux-"`date +'%Y%m%d%H%M%S'`" |
|
||||||
|
|||||||
Reference in New Issue
Block a user