scripts/update_repo_git.sh

25 lines
572 B
Bash
Raw Permalink Normal View History

2016-10-14 09:40:07 +02:00
#!/bin/bash
update() {
REPO_URL="${1}"
REPO_PATH="${2}"
`ping -q -c 3 "${REPO_URL}" > /dev/null 2>&1`
# If $REPO_URL is available
if [ $? -eq 0 ]; then
echo "${REPO_URL} is available"
pushd "${REPO_PATH}" > /dev/null 2>&1
git pull > /dev/null 2>&1
popd > /dev/null 2>&1
else
echo "${REPO_URL} is not available"
fi
}
# Update Puppet IPR repo
2017-12-12 09:31:55 +01:00
update "git1.ipr.univ-rennes1.fr" "/home/jegardai/repos/ipr_puppet"
2016-10-14 09:40:07 +02:00
# Update Gardouille www data (dokuwiki, shaarli, respawn, ...)
2017-12-12 09:31:55 +01:00
update "www.google.fr" "/home/jegardai/repos/gardouille_www"
2016-10-14 09:40:07 +02:00