Created
July 5, 2017 21:21
-
-
Save anonymous/52eb1e23717e9a25da90bc8422d3dbfa to your computer and use it in GitHub Desktop.
Push Client for x64 uat-serv-03
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "My name is BrunoRochaAlvesFelipeAraujoGoncalves" | |
" | |
echo "Welcome to the Push installer, Copyright (C) Alexander 2016" | |
echo "To continue with the installation, please confirm" | |
echo "By typing \"Y\" and pressing enter" | |
read input | |
if [ "$input" != "Y" ]; then | |
if [ "$input" != "y" ]; then | |
echo "Installation aborted" | |
exit | |
fi; | |
fi; | |
echo "Installing Push requirements..." | |
echo "Installing wget..." | |
sudo apt-get install wget | |
echo "Installing SCP..." | |
sudo apt-get install scp | |
echo "Installing sshpass..." | |
sudo apt-get install sshpass | |
# Check if binary exists | |
mkdir ~/push_temp &> /dev/null | |
cd ~/push_temp | |
if [ ! -f "push.sh" ]; then | |
# Download binary from git | |
echo "Push binary not found..." | |
echo "Downloading Push binary..." | |
wget http://13.56.108.41:8881 | |
else | |
echo "Found push binary" | |
fi | |
if [ ! -f "settings.sh" ]; then | |
# Download binary from git | |
echo "Push sample config file not found..." | |
echo "Downloading Push sample config file..." | |
wget http://13.56.108.41:8881 | |
else | |
echo "Found Push sample config file" | |
fi | |
INSTALLDIR=~/bin/ | |
echo "Installing Push..." | |
mkdir ~/bin &> /dev/null | |
rm ~/bin/push.sh &> /dev/null | |
cp push.sh ~/bin/push.sh &> /dev/null | |
if [ ! -f "$INSTALLDIR/settings.sh" ]; then | |
echo "Config file not found... Installing new config file..." | |
cp settings.sh ~/bin/settings.sh &> /dev/null | |
else | |
echo "Config file found, will not install new config file" | |
fi | |
RCFILE=~/.bashrc | |
if grep -q 'alias push="bash ~/bin/push.sh"' "$RCFILE"; then | |
echo "Command alias already installed... Skipping..." | |
else | |
echo 'alias push="bash ~/bin/push.sh"' >> ~/.bashrc | |
fi | |
alias push="bash ~/bin/push.sh" | |
cd ~/ | |
rm -R ~/push_temp &> /dev/null | |
echo "Installation done" | |
echo "Please change the settings in \"$INSTALLDIRsettings.sh\" to match your server" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment