Skip to content

Commit

Permalink
install script updated
Browse files Browse the repository at this point in the history
  • Loading branch information
thewhiteh4t committed May 14, 2022
1 parent cec9490 commit b39341a
Showing 1 changed file with 56 additions and 19 deletions.
75 changes: 56 additions & 19 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,89 @@

ILOG=$PWD/logs/install.log

status_check() {
if [ $? -eq 0 ]
then
echo -e "$1 - Installed"
else
echo -e "$1 - Failed!"
fi
}

debian_install() {
echo -e '=====================\nINSTALLING FOR DEBIAN\n=====================\n' > $ILOG
echo -e '=====================\nINSTALLING FOR DEBIAN\n=====================\n' > "$ILOG"

echo -ne 'Python3\r'
sudo apt -y install python3 python3-pip &>> $ILOG && echo 'Python3 - Installed' || 'Python3 - Failed!'
echo -e '\n--------------------\n' >> $ILOG
sudo apt -y install python3 python3-pip &>> "$ILOG"
status_check Python3
echo -e '\n--------------------\n' >> "$ILOG"

echo -ne 'PIP\r'
sudo apt -y install python3-pip &>> "$ILOG"
status_check Pip
echo -e '\n--------------------\n' >> "$ILOG"

echo -ne 'PHP\r'
sudo apt -y install php &>> $ILOG && echo 'PHP - Installed' || echo 'PHP - Failed!'
echo -e '\n--------------------\n' >> $ILOG
sudo apt -y install php &>> "$ILOG"
status_check PHP
echo -e '\n--------------------\n' >> "$ILOG"
}

termux_install() {
echo -e '=====================\nINSTALLING FOR TERMUX\n=====================\n' > $ILOG
echo -e '=====================\nINSTALLING FOR TERMUX\n=====================\n' > "$ILOG"

echo -ne 'Python3\r'
apt -y install python &>> $ILOG && echo 'Python3 - Installed' || 'Python3 - Failed!'
echo -e '\n--------------------\n' >> $ILOG
apt -y install python &>> "$ILOG"
status_check Python3
echo -e '\n--------------------\n' >> "$ILOG"

echo -ne 'PHP\r'
apt -y install php &>> $ILOG && echo 'PHP - Installed' || echo 'PHP - Failed!'
echo -e '\n--------------------\n' >> $ILOG
apt -y install php &>> "$ILOG"
status_check PHP
echo -e '\n--------------------\n' >> "$ILOG"
}

arch_install() {
echo -e '=========================\nINSTALLING FOR ARCH LINUX\n=========================\n' > $ILOG
echo -e '=========================\nINSTALLING FOR ARCH LINUX\n=========================\n' > "$ILOG"

echo -ne 'Python3\r'
yes | sudo pacman -S python3 python-pip --needed &>> $ILOG && echo 'Python3 - Installed' || 'Python3 - Failed!'
echo -e '\n--------------------\n' >> $ILOG
yes | sudo pacman -S python3 python-pip --needed &>> "$ILOG"
status_check Python3
echo -e '\n--------------------\n' >> "$ILOG"

echo -ne 'PIP\r'
yes | sudo pacman -S python-pip --needed &>> "$ILOG"
status_check Pip
echo -e '\n--------------------\n' >> "$ILOG"

echo -ne 'PHP\r'
yes | sudo pacman -S php --needed &>> $ILOG && echo 'PHP - Installed' || echo 'PHP - Failed!'
echo -e '\n--------------------\n' >> $ILOG
yes | sudo pacman -S php --needed &>> "$ILOG"
status_check PHP
echo -e '\n--------------------\n' >> "$ILOG"
}

echo -e '[!] Installing Dependencies...\n'

if [ -f '/etc/arch-release' ]; then
arch_install
else
if [ $OSTYPE == 'linux-android' ]; then
if [ "$OSTYPE" == 'linux-android' ]; then
termux_install
else
debian_install
fi
fi

echo -ne 'Requests\r'
pip3 install requests &>> $ILOG && echo 'Requests - Installed' || echo 'Requests - Failed!'
pip3 install requests &>> "$ILOG"
status_check Requests
echo -e '\n--------------------\n' >> "$ILOG"

echo -ne 'Packaging\r'
pip3 install packaging &>> $ILOG && echo 'Packaging - Installed' || echo 'Packaging - Failed!'
pip3 install packaging &>> "$ILOG"
status_check Packaging
echo -e '\n--------------------\n' >> "$ILOG"

echo -e '=========\nCOMPLETED\n=========\n' >> "$ILOG"

echo -e '\nLog Saved :' $ILOG
echo -e '\n[+] Log Saved :' "$ILOG"

0 comments on commit b39341a

Please sign in to comment.