Skip to content

Commit

Permalink
commit 488897999 on 20200709
Browse files Browse the repository at this point in the history
  • Loading branch information
SDRausty committed Jul 9, 2020
1 parent f58ee1b commit a2e8c54
Show file tree
Hide file tree
Showing 13 changed files with 578 additions and 470 deletions.
2 changes: 1 addition & 1 deletion .conf/VERSIONID
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.13
2.0.16
92 changes: 58 additions & 34 deletions archlinuxconfig.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/env bash
# Copyright 2017-2019 by SDRausty. All rights reserved. 🌎 🌍 🌏 🌐 🗺
#!/usr/bin/env bash
# Copyright 2017-2020 by SDRausty. All rights reserved. 🌎 🌍 🌏 🌐 🗺
# Hosted sdrausty.github.io/TermuxArch courtesy https://pages.github.com
# https://sdrausty.github.io/TermuxArch/README has info about this project.
# https://sdrausty.github.io/TermuxArch/CONTRIBUTORS Thank you for your help.
Expand Down Expand Up @@ -30,7 +30,7 @@ _ADDAUSER_() {
echo "Use: addauser username"
exit 201
else
useradd "\$1"
useradd -s /bin/bash "\$1"
cp -r /root /home/"\$1"
su - "\$1"
fi
Expand All @@ -57,44 +57,44 @@ _ADDbash_profile_() {
fi
PATH="\$HOME/bin:\$PATH"
PS1="[\[\e[38;5;148m\]\u\[\e[1;0m\]\A\[\e[1;38;5;112m\]\W\[\e[0m\]]$ "
export GPG_TTY="\$(tty)"
export TZ="$(getprop persist.sys.timezone)"
EOM
for i in "${!LC_TYPE[@]}"; do
for i in "${!LC_TYPE[@]}"
do
printf "%s=\"%s\"\\n" "export ${LC_TYPE[i]}" "$ULANGUAGE.UTF-8" >> root/.bash_profile
done
if [ -e "$HOME"/.bash_profile ] ; then
if [ -e "$HOME"/.bash_profile ]
then
grep proxy "$HOME"/.bash_profile |grep "export" >> root/.bash_profile 2>/dev/null ||:
fi
}

_ADDbashrc_() {
cat > root/.bashrc <<- EOM
PATH=\$PATH:$PREFIX/bin:$PREFIX/bin/applets
alias c='cd .. && pwd'
alias ..='cd ../.. && pwd'
alias ...='cd ../../.. && pwd'
alias ....='cd ../../../.. && pwd'
alias .....='cd ../../../../.. && pwd'
alias d='du -hs'
alias e='exit'
alias egrep='egrep --color=always'
alias f='fgrep --color=always'
alias g='ga; gcm; gp'
alias f='grep --color=always'
alias g='ga ; gcm ; gp'
alias gca='git commit -a -S'
alias gcam='git commit -a -S -m'
alias grep='grep --color=always'
alias h='history >> \$HOME/.historyfile'
alias j='jobs'
alias i='whoami'
alias l='ls -og'
alias lr='ls -alR'
alias ls='ls --color=always'
alias l='ls -al --color=always'
alias lr='ls -alR --color=always'
alias n2='nice -n -20'
alias p='pwd'
alias pacman='pacman --color=always'
alias pcs='pacman -S --color=always'
alias pcss='pacman -Ss --color=always'
alias q='exit'
# Use executables in Termux's PATH as a last resort
PATH=\$PATH:/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets
EOM
if [ -e "$HOME"/.bashrc ] ; then
grep proxy "$HOME"/.bashrc | grep "export" >> root/.bashrc 2>/dev/null ||:
Expand All @@ -104,7 +104,7 @@ _ADDbashrc_() {
_ADDcdtd_() {
_CFLHD_ root/bin/cdtd "# Usage: \`. cdtd\` the dot sources \`cdtd\` which makes this shortcut script work."
cat > root/bin/cdtd <<- EOM
#!/bin/env bash
#!/usr/bin/env bash
cd "$HOME/storage/downloads" && pwd
EOM
chmod 700 root/bin/cdtd
Expand All @@ -113,7 +113,7 @@ _ADDcdtd_() {
_ADDcdth_() {
_CFLHD_ root/bin/cdth "# Usage: \`. cdth\` the dot sources \`cdth\` which makes this shortcut script work."
cat > root/bin/cdth <<- EOM
#!/bin/env bash
#!/usr/bin/env bash
cd "$HOME" && pwd
EOM
chmod 700 root/bin/cdth
Expand All @@ -122,7 +122,7 @@ _ADDcdth_() {
_ADDcdtmp_() {
_CFLHD_ root/bin/cdtmp "# Usage: \`. cdtmp\` the dot sources \`cdtmp\` which makes this shortcut script work."
cat > root/bin/cdtmp <<- EOM
#!/bin/env bash
#!/usr/bin/env bash
cd "$PREFIX/tmp" && pwd
EOM
chmod 700 root/bin/cdtmp
Expand Down Expand Up @@ -272,12 +272,15 @@ _ADDfbindprocstat8_() {
}

_ADDfbindexample_() {
_CFLHDRS_ var/binds/fbindexample.prs "# To regenerate the start script use \`setupTermuxArch.bash re[fresh]\`. Add as many proot statements as you want; The init script will parse this file at refresh. Examples are included for convenience. Usage: PROOTSTMNT+=\"-b host_path:guest_path \" The space before the last double quote is necessary."
_CFLHDRS_ var/binds/fbindexample.prs "# Before regenerating the start script with \`setupTermuxArch.bash re[fresh]\`, first copy this file to another name such as \`fbinds.prs\`. Then add as many proot statements as you want; The init script will parse file \`fbinds.prs\` at refresh adding these proot options to \`$STARTBIN\`. Examples are included for convenience. The space before the last double quote is necessary."
cat >> var/binds/fbindexample.prs <<- EOM
# Usage: PROOTSTMNT+=\"-b host_path:guest_path \" # The space before the last double quote is necessary."
# PROOTSTMNT+=" -q $PREFIX/bin/qemu-x86_64 "
# PROOTSTMNT+="-b $INSTALLDIR/var/binds/fbindprocstat:/proc/stat "
# if [[ ! -r /dev/shm ]] ; then
# PROOTSTMNT+="-b $INSTALLDIR/tmp:/dev/shm "
# fi
# fbindexample.prs EOF
EOM
}

Expand All @@ -298,7 +301,8 @@ _ADDfibs_() {
_ADDga_() {
_CFLHDR_ root/bin/ga
cat >> root/bin/ga <<- EOM
if [ ! -e /usr/bin/git ] ; then
if [[ ! -x "\$(command -v git)" ]]
then
pacman --noconfirm --color=always -S git
git add .
else
Expand All @@ -311,7 +315,8 @@ _ADDga_() {
_ADDgcl_() {
_CFLHDR_ root/bin/gcl
cat >> root/bin/gcl <<- EOM
if [ ! -e /usr/bin/git ] ; then
if [[ ! -x "\$(command -v git)" ]]
then
pacman --noconfirm --color=always -S git
git clone "\$@"
else
Expand All @@ -324,7 +329,8 @@ _ADDgcl_() {
_ADDgcm_() {
_CFLHDR_ root/bin/gcm
cat >> root/bin/gcm <<- EOM
if [ ! -e /usr/bin/git ] ; then
if [[ ! -x "\$(command -v git)" ]]
then
pacman --noconfirm --color=always -S git
git commit
else
Expand All @@ -337,7 +343,8 @@ _ADDgcm_() {
_ADDgpl_() {
_CFLHDR_ root/bin/gpl
cat >> root/bin/gpl <<- EOM
if [ ! -e /usr/bin/git ] ; then
if [[ ! -x "\$(command -v git)" ]]
then
pacman --noconfirm --color=always -S git
git pull
else
Expand All @@ -350,7 +357,8 @@ _ADDgpl_() {
_ADDgp_() {
_CFLHDR_ root/bin/gp "# git push https://username:password@github.com/username/repository.git master"
cat >> root/bin/gp <<- EOM
if [ ! -e /usr/bin/git ] ; then
if [[ ! -x "\$(command -v git)" ]]
then
pacman --noconfirm --color=always -S git
git push
else
Expand All @@ -360,6 +368,12 @@ _ADDgp_() {
chmod 700 root/bin/gp
}

_ADDinputrc() {
cat > root/.inputrc <<- EOM
set bell-style none
EOM
}

_ADDkeys_() {
_CFLHDR_ root/bin/keys
cat >> root/bin/keys <<- EOM
Expand Down Expand Up @@ -428,9 +442,16 @@ _ADDkeys_() {
}

_ADDMOTD_() {
cat > etc/motd <<- EOM
printf "\n\e[1;34mWelcome to Arch Linux in Termux!\nInstall a package: \e[0;34mpacman -S package\n\e[1;34mMore information: \e[0;34mpacman -[D|F|Q|R|S|T|U]h\n\e[1;34mSearch packages: \e[0;34mpacman -Ss query\n\e[1;34mUpgrade packages: \e[0;34mpacman -Syu\n\n\e[1;34mChat: \e[0mwiki.termux.com/wiki/Community\n\e[1;34mHelp: \e[0;34minfo query \e[1;34mand \e[0;34mman query\n\e[1;34mIRC: \e[0mwiki.archlinux.org/index.php/IRC_channel\n\n\e[0m"
EOM
if [[ "$CPUABI" = "$CPUABIX86" ]] || [[ "$CPUABI" = "$CPUABIX86_64" ]]
then
cat > etc/motd <<- EOM
printf "\n\e[1;34mWelcome to Arch Linux in Termux!\nInstall a package: \e[0;34mpacman -S package\n\e[1;34mMore information: \e[0;34mpacman -[D|F|Q|R|S|T|U]h\n\e[1;34mSearch packages: \e[0;34mpacman -Ss query\n\e[1;34mUpgrade packages: \e[0;34mpacman -Syu\n\n\e[1;34mChat: \e[0mwiki.termux.com/wiki/Community\n\e[1;34mHelp: \e[0;34minfo query \e[1;34mand \e[0;34mman query\n\e[1;34mIRC: \e[0mwiki.archlinux.org/index.php/IRC_channel\n\n\e[0m"
EOM
else
cat > etc/motd <<- EOM
printf "\n\e[1;34mWelcome to Arch Linux in Termux!\nInstall a package: \e[0;34mpacman -S package\n\e[1;34mMore information: \e[0;34mpacman -[D|F|Q|R|S|T|U]h\n\e[1;34mSearch packages: \e[0;34mpacman -Ss query\n\e[1;34mUpgrade packages: \e[0;34mpacman -Syu\n\n\e[1;34mChat: \e[0mhttps://wiki.termux.com/wiki/Community\n\e[1;34mHelp: \e[0;34minfo query \e[1;34mand \e[0;34mman query\n\e[1;34mForum: \e[0mhttps://archlinuxarm.org/forum\n\n\e[0m"
EOM
fi
}

_ADDMOTO_() {
Expand Down Expand Up @@ -531,7 +552,8 @@ _ADDaddresolvconf_() {
_ADDt_() {
_CFLHDR_ root/bin/t
cat >> root/bin/t <<- EOM
if [ ! -e /usr/bin/tree ] ; then
if [[ ! -x "\$(command -v tree)" ]]
then
pacman --noconfirm --color=always -S tree
tree "\$@"
else
Expand Down Expand Up @@ -608,15 +630,16 @@ _ADDv_() {
_CFLHDR_ root/bin/v
cat >> root/bin/v <<- EOM
if [[ -z "\${1:-}" ]] ; then
ARGS="."
ARGS=(".")
else
ARGS="\$@"
ARGS=("\$@")
fi
if [ ! -e /usr/bin/vim ] ; then
if [[ ! -x "\$(command -v vim)" ]]
then
pacman --noconfirm --color=always -S vim
vim "\$@"
vim "\${ARGS[@]}"
else
vim "\$@"
vim "\${ARGS[@]}"
fi
EOM
chmod 700 root/bin/v
Expand Down Expand Up @@ -688,7 +711,7 @@ _ADDwe_() {
tbcif=\$(command -v bc) ||:
if [[ \$tbcif = "" ]] ; then
printf "\e[1;34mInstalling \e[0;32mbc\e[1;34m…\n\n\e[1;32m"
pkg install bc --yes
apt install bc --yes
printf "\n\e[1;34mInstalling \e[0;32mbc\e[1;34m: \e[1;32mDONE\n\e[0m"
fi
fi
Expand Down Expand Up @@ -770,7 +793,8 @@ _ADDwe_() {
_ADDyt_() {
_CFLHDR_ root/bin/yt
cat >> root/bin/yt <<- EOM
if [ ! -e /usr/bin/youtube-dl ] ; then
if [[ ! -x "\$(command -v youtube-dl)" ]]
then
pacman --noconfirm --color=always -S youtube-dl
youtube-dl "\$@"
else
Expand Down
4 changes: 2 additions & 2 deletions espritfunctions.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/env bash
# Copyright 2017-2019 by SDRausty. All rights reserved. 🌎 🌍 🌏 🌐 🗺
#!/usr/bin/env bash
# Copyright 2017-2020 by SDRausty. All rights reserved. 🌎 🌍 🌏 🌐 🗺
# Hosted sdrausty.github.io/TermuxArch courtesy https://pages.github.com
# https://sdrausty.github.io/TermuxArch/README has info about this project.
# https://sdrausty.github.io/TermuxArch/CONTRIBUTORS Thank you for your help.
Expand Down
59 changes: 28 additions & 31 deletions getimagefunctions.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/env bash
# Copyright 2017-2019 by SDRausty. All rights reserved. 🌎 🌍 🌏 🌐 🗺
#!/usr/bin/env bash
# Copyright 2017-2020 by SDRausty. All rights reserved. 🌎 🌍 🌏 🌐 🗺
# Hosted sdrausty.github.io/TermuxArch courtesy https://pages.github.com
# https://sdrausty.github.io/TermuxArch/README has info about this project.
# https://sdrausty.github.io/TermuxArch/CONTRIBUTORS Thank you for your help.
Expand All @@ -9,19 +9,19 @@ _FTCHIT_() {
_PRINT_DOWNLOADING_FTCHIT_
if [[ "$DM" = aria2 ]]
then
aria2c -c -Z http://"$CMIRROR$RPATH$IFILE".md5 http://"$CMIRROR$RPATH$IFILE"
aria2c -c -Z http://"$CMIRROR/$RPATH/$IFILE".md5 http://"$CMIRROR/$RPATH/$IFILE"
elif [[ "$DM" = axel ]]
then
axel http://"$CMIRROR$RPATH$IFILE".md5
axel http://"$CMIRROR$RPATH$IFILE"
axel http://"$CMIRROR/$RPATH/$IFILE".md5
axel http://"$CMIRROR/$RPATH/$IFILE"
elif [[ "$DM" = lftp ]]
then
lftpget -c http://"$CMIRROR$RPATH$IFILE".md5 http://"$CMIRROR$RPATH$IFILE"
lftpget -c http://"$CMIRROR/$RPATH/$IFILE".md5 http://"$CMIRROR/$RPATH/$IFILE"
elif [[ "$DM" = wget ]]
then
wget "$DMVERBOSE" -c --show-progress -N http://"$CMIRROR$RPATH$IFILE".md5 http://"$CMIRROR$RPATH$IFILE"
wget "$DMVERBOSE" -c --show-progress -N http://"$CMIRROR/$RPATH/$IFILE".md5 http://"$CMIRROR/$RPATH/$IFILE"
else
curl "$DMVERBOSE" -C - --fail --retry 4 -OL http://"$CMIRROR$RPATH$IFILE".md5 -O http://"$CMIRROR$RPATH$IFILE"
curl "$DMVERBOSE" -C - --fail --retry 4 -OL {"http://$CMIRROR/$RPATH/$IFILE.md5,http://$CMIRROR/$RPATH/$IFILE"}
fi
}

Expand All @@ -34,16 +34,16 @@ _FTCHSTND_() {
NLCMIRROR="$(grep Redirecting "$TAMPDIR/global2localmirror" | awk {'print $8'})"
_PRINTDONE_
_PRINTDOWNLOADINGFTCH_
aria2c -c -m 4 -Z "$NLCMIRROR$RPATH$IFILE".md5 "$NLCMIRROR$RPATH$IFILE"
aria2c -c -m 4 -Z "$NLCMIRROR/$RPATH/$IFILE".md5 "$NLCMIRROR/$RPATH/$IFILE"
elif [[ "$DM" = axel ]]
then
axel -vv http://"$CMIRROR" 1 > "$TAMPDIR/global2localmirror"
NLCMIRR="$(grep downloading "$TAMPDIR/global2localmirror" | awk {'print $5'})"
NLCMIRROR="${NLCMIRR::-3}"
_PRINTDONE_
_PRINTDOWNLOADINGFTCH_
axel -a http://"$NLCMIRROR$RPATH$IFILE".md5
axel -a http://"$NLCMIRROR$RPATH$IFILE"
axel -a http://"$NLCMIRROR/$RPATH/$IFILE".md5
axel -a http://"$NLCMIRROR/$RPATH/$IFILE"
elif [[ "$DM" = lftp ]]
then
lftp -e get http://"$CMIRROR" 2>&1 | tee>"$TAMPDIR/global2localmirror"
Expand All @@ -52,53 +52,50 @@ _FTCHSTND_() {
NLCMIRROR="${NLCMIRR//\'}"
_PRINTDONE_
_PRINTDOWNLOADINGFTCH_
lftpget -c "$NLCMIRROR$RPATH$IFILE".md5 "$NLCMIRROR$RPATH$IFILE"
lftpget -c "$NLCMIRROR/$RPATH/$IFILE".md5 "$NLCMIRROR/$RPATH/$IFILE"
elif [[ "$DM" = wget ]]
then
wget -v -O/dev/null "$CMIRROR" 2>"$TAMPDIR/global2localmirror"
NLCMIRROR="$(grep Location "$TAMPDIR/global2localmirror" | awk {'print $2'})"
_PRINTDONE_
_PRINTDOWNLOADINGFTCH_
wget "$DMVERBOSE" -c --show-progress "$NLCMIRROR$RPATH$IFILE".md5 "$NLCMIRROR$RPATH$IFILE"
wget "$DMVERBOSE" -c --show-progress "$NLCMIRROR/$RPATH/$IFILE".md5 "$NLCMIRROR/$RPATH/$IFILE"
else
curl -v "$CMIRROR" &> "$TAMPDIR/global2localmirror"
_FMIRROR_
curl "$DMVERBOSE" -C - --fail --retry 4 -O "${NLCMIRROR::-2}$RPATH$IFILE".md5 -O "${NLCMIRROR::-2}$RPATH$IFILE"
NLCMIRROR="$(grep Location "$TAMPDIR/global2localmirror" | awk {'print $3'})"
NLCMIRROR="${NLCMIRROR%$'\r'}" # remove trailing carrage return. Search string: strip bash variable non printing characters
_PRINTDONE_
_PRINTDOWNLOADINGFTCH_
curl "$DMVERBOSE" -C - --fail --retry 4 -OL {"$NLCMIRROR/$RPATH/$IFILE.md5,$NLCMIRROR/$RPATH/$IFILE"}
fi
}

_FMIRROR_() {
NLCMIRROR="$(grep Location "$TAMPDIR/global2localmirror" | awk {'print $3'})"
_PRINTDONE_
_PRINTDOWNLOADINGFTCH_
}

_GETIMAGE_() {
_PRINTDOWNLOADINGX86_
if [[ "$DM" = aria2 ]]
then
aria2c http://"$CMIRROR$RPATH$IFILE".md5
aria2c http://"$CMIRROR/$RPATH/$IFILE".md5
_ISX86_
aria2c -c http://"$CMIRROR$RPATH$IFILE"
aria2c -c http://"$CMIRROR/$RPATH/$IFILE"
elif [[ "$DM" = axel ]]
then
axel http://"$CMIRROR$RPATH$IFILE".md5
axel http://"$CMIRROR/$RPATH/$IFILE".md5
_ISX86_
axel http://"$CMIRROR$RPATH$IFILE"
axel http://"$CMIRROR/$RPATH/$IFILE"
elif [[ "$DM" = lftp ]]
then
lftpget http://"$CMIRROR$RPATH"md5sums.txt
lftpget http://"$CMIRROR/$RPATH"/md5sums.txt
_ISX86_
lftpget -c http://"$CMIRROR$RPATH$IFILE"
lftpget -c http://"$CMIRROR/$RPATH/$IFILE"
elif [[ "$DM" = wget ]]
then
wget "$DMVERBOSE" -N --show-progress http://"$CMIRROR$RPATH"md5sums.txt
wget "$DMVERBOSE" -N --show-progress http://"$CMIRROR/$RPATH/"md5sums.txt
_ISX86_
wget "$DMVERBOSE" -c --show-progress http://"$CMIRROR$RPATH$IFILE"
wget "$DMVERBOSE" -c --show-progress http://"$CMIRROR/$RPATH/$IFILE"
else
curl "$DMVERBOSE" --fail --retry 4 -OL http://"$CMIRROR$RPATH"md5sums.txt
curl "$DMVERBOSE" --fail --retry 4 -OL http://"$CMIRROR/$RPATH"/md5sums.txt
_ISX86_
curl "$DMVERBOSE" -C - --fail --retry 4 -OL http://"$CMIRROR$RPATH$IFILE"
curl "$DMVERBOSE" -C - --fail --retry 4 -OL http://"$CMIRROR/$RPATH/$IFILE"
fi
}

Expand Down
Loading

0 comments on commit a2e8c54

Please sign in to comment.