Last active
August 29, 2015 13:56
-
-
Save datherra/8918877 to your computer and use it in GitHub Desktop.
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 | |
mkdir -p trash | |
LOG=trash/$$_my_script.log | |
echo "Started" >> $LOG | |
echo "Find my log file investigating my source ;)" | |
sleep 120 | |
# tip: -neq means "not equal to" | |
which apt-get | |
if [ $? -eq 0 ]; then | |
sudo apt-get install dstat >> $LOG | |
else | |
echo "not a debian based distro" >> $LOG | |
fi | |
# tip: -eq means "equal to" | |
which yum | |
if [ $? -eq 0 ]; then | |
sudo yum install -y dstat && echo "dstat installed" >> $LOG | |
else | |
echo "ERROR. Check log file" >> $LOG | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment