Last active
April 23, 2016 11:00
-
-
Save sysarcher/c3424bde1821a58a1088367b8508ad84 to your computer and use it in GitHub Desktop.
What I run on a fresh install
This file contains hidden or 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
function getLastAptGetUpdate() | |
{ | |
local -r aptDate="$(stat -c %Y '/var/cache/apt')" | |
local -r nowDate="$(date +'%s')" | |
echo $((nowDate - aptDate)) | |
} | |
# Default To 24 hours | |
updateInterval="$((24 * 60 * 60))" | |
lastAptGetUpdate="$(getLastAptGetUpdate)" | |
if [[ "${lastAptGetUpdate}" -gt "${updateInterval}" ]] | |
then | |
sudo apt-get update | |
else | |
#lastUpdate="$(date -u -d @"${lastAptGetUpdate}" +'%-Hh %-Mm %-Ss')" | |
echo "Skip apt-get update because it was run within | |
last ${updateInterval} seconds" | |
fi | |
sudo apt-get install -y curl | |
sudo apt-get install -y python-dev python-pip | |
sudo pip install ansible |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment