General Release (#1)
* Add two new location shorcuts and a fix for ffmpeg. * Add comments and a quick commit function. * More fixes and enhancements. * Enhance ffmpeg command with resolution changing. * Try fixing the test function. * Prevent situations such as possibly deleting a home directory. * Use dev branch for testing. Add man to software. * Always accept. * Do not cd as part of bashrc. * Try fixing path issue. * Try fixing PROG from just saying bash. * More path and PROG fixes. * Final cleanups. Seems good now. * test-termux works great now! * Add aliases for reloading the Termux config project (this Git repo). * Add missing slash. * Fix double flagging bitrates. * Show the ffmpeg command. Print file sizes. Planning to come back later with a laptop and clean up tabs vs spaces. Difficult to manage on a phone. * Move input to be before options. * Fix filter parameters. * Remove single quotes. * Fix typos. * Add more shortcut aliases. * Add more packages. * Update instructions and mention shortcut aliases. * Fix extra period. * Add more aliases. * Add extra detail to final instruction. * Better formatting on new text. * Add aliases, fix spaces to tabs. * Change order of parameters so that size is first. * Add wget to default packages. * Add two-pass processing. * More changes for 2-pass. * Add ability to still do 1 pass. Add sync before filesize check. Clean 2-pass files. * Add better chance of getting correct filesize with a sleep. Make ffmpeg 2 pass file name more explicit. * Change to maxrate from b:v so that ffmpeg can determine the best rate per frame. * First attempt at adding basic-process for a more flexible ffmpeg experience. * Multiple bugfixes and enhancements for video functions. * Only remove first pass files if everything succeeded. Sleep before doing IF for file size.
This commit is contained in:
46
setup.sh
46
setup.sh
@@ -1,40 +1,43 @@
|
||||
# No Shebang For Termux
|
||||
# 2024-02-10 Hyperling
|
||||
|
||||
echo "`date` - Starting Hyperling's Termux Setup"
|
||||
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
||||
echo "`date` - Starting $PROG"
|
||||
|
||||
DIR="`dirname $0`"
|
||||
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
||||
cd $DIR
|
||||
DIR="`pwd`"
|
||||
echo "Working in '$DIR'."
|
||||
|
||||
echo -e "\n`date` - Upgrade Package Repos"
|
||||
pkg update &&
|
||||
pkg upgrade
|
||||
pkg upgrade -y
|
||||
|
||||
echo -e "\n`date` - Check Storage Permission"
|
||||
if [[ ! -e ~/storage/shared ]]; then
|
||||
sleep 3
|
||||
termux-setup-storage
|
||||
if [[ -e ~/storage/shared/ ]]; then
|
||||
echo "~/storage/shared/ now exists. :)"
|
||||
sleep 3
|
||||
termux-setup-storage
|
||||
if [[ -e ~/storage/shared/ ]]; then
|
||||
echo "~/storage/shared/ now exists. :)"
|
||||
else
|
||||
echo "ERROR: Something ain't right, Jim! Abort!" >&2
|
||||
echo "ERROR: Something ain't right, Jim! Abort!" >&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Everything looks good already, pal."
|
||||
echo "Everything looks good already, pal."
|
||||
fi
|
||||
|
||||
echo -e "\n`date` - Install Software"
|
||||
pkg install \
|
||||
openssh tsu vim htop git cronie \
|
||||
nmap traceroute \
|
||||
ffmpeg
|
||||
pkg install -y \
|
||||
openssh tsu vim htop git cronie man \
|
||||
nmap traceroute wget \
|
||||
ffmpeg imagemagick \
|
||||
kotlin php nodejs python libllvm
|
||||
|
||||
echo -e "\n`date` - BASH Environment"
|
||||
if [[ ! -e ~/.env ]]; then
|
||||
if [[ -e env.example ]]; then
|
||||
mv -v env.example ~/.env
|
||||
mv -v env.example ~/.env
|
||||
else
|
||||
echo "ERROR: Neither .env or env.example found." >&2
|
||||
fi
|
||||
@@ -46,7 +49,7 @@ fi
|
||||
if [[ -e bashrc.sh ]]; then
|
||||
mv -v bashrc.sh ~/.bashrc
|
||||
else
|
||||
echo "ERROR: bashrc.sh not found, skipping." >&2
|
||||
echo "ERROR: bashrc.sh not found, skipping." >&2
|
||||
fi
|
||||
|
||||
echo -e "\n`date` - Cleanup"
|
||||
@@ -58,16 +61,21 @@ if [[ ! -e ~/storage/shared/TRASH ]]; then
|
||||
fi
|
||||
ln -s ~/storage/shared/TRASH ~/TRASH
|
||||
|
||||
cd ..
|
||||
if [[ -n $DIR && $DIR != "/" ]]; then
|
||||
if [[ -n $DIR && $DIR != "/" && -d .git ]]; then
|
||||
echo "We are in a git clone, remove the project."
|
||||
cd ..
|
||||
mv -v $DIR ~/TRASH/termux-"`date +'%Y%m%d%H%M%S'`" |
|
||||
grep -v '/.git/'
|
||||
else
|
||||
echo "File was used individually, remove it."
|
||||
mv "$PROG" ~/TRASH/
|
||||
fi
|
||||
|
||||
echo -e "\n*******"
|
||||
echo "Don't forget to reload your environment!"
|
||||
echo " source .bashrc"
|
||||
echo " source ~/.bashrc"
|
||||
echo "*******"
|
||||
|
||||
echo -e "\n`date` - Finished Hyperling's Termux Setup"
|
||||
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
||||
echo -e "\n`date` - Finished $PROG"
|
||||
exit 0
|
||||
|
Reference in New Issue
Block a user