Skip to content

Instantly share code, notes, and snippets.

@p4p1
Last active April 30, 2020 22:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save p4p1/38be0de4c1cad30bd7b96f06e0065022 to your computer and use it in GitHub Desktop.
Save p4p1/38be0de4c1cad30bd7b96f06e0065022 to your computer and use it in GitHub Desktop.
🍤🍤🍤🍤
#!/bin/bash
# phone.sh
# Created on: ven. 24 avril 2020 06:21:51 CEST
#
# ____ __ ____ __
# ( _ \ /. |( _ \/ )
# )___/(_ _))___/ )(
# (__) __ (_)(__) _(__) ____ __ ____
# ( \/ )( _ )( _ \(_ _)( ) ( ___)
# ) ( )(_)( ) _ < _)(_ )(__ )__)
# (_/\/\_)(_____)(____/(____)(____)(____)
#
# Description:
# My installation script for termux on android devices
# Usage:
# chmod +x phone.sh && ./phone.sh
packages=(vifm vim git openssh python nmap make clang gdb tmux termux-api unstable-repo x11-repo tigervnc)
config="https://p4p1.github.io/phone_backup.tar.xz"
for item in ${packages[*]}; do
echo -n "Checking $item -> "
if hash $item &> /dev/null;then
echo -e "\e[1;34m:)\e[m"
else
echo -e "\e[1;31m:(\e[m"
pkg install -y $item
fi
done
curl $config --output backup.tar.xz
tar xf ./backup.tar.xz
for item in $(ls -a ./phone_backup/ | sed 1,2d); do
echo -e "\e[1;34mAdding\e[m $item in $HOME/ directory"
[ -f $HOME/$item ] && rm -rf $HOME/$item
[ -d $HOME/$item ] && rm -rf $HOME/$item
cp -r ./phone_backup/$item $HOME/$item
done
rm -rf phone_backup
rm -rf backup.tar.xz
echo -n "Checking for shh key -> "
if [ -f $HOME/.ssh/id_rsa.pub -a -f $HOME/.ssh/id_rsa ]; then
echo -e "\e[1;34m:)\e[m"
else
echo -e "\e[1;31m:(\e[m"
ssh-keygen
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment