1
0
Fork 0

Modification pour lancer le script et éviter le spam de wall vides

This commit is contained in:
Teo-CD 2019-05-20 17:05:13 +02:00 committed by trotFunky
parent 03ea6eafc8
commit 9c881c366e
2 changed files with 7 additions and 3 deletions

View file

@ -47,7 +47,7 @@ for GIT_REPO in $work_array ; do
remoteStatus="$(git fetch --dry-run 2>&1 | tail -n 1 | grep -v -e'+')" # Empty if there are no commits to fetch remoteStatus="$(git fetch --dry-run 2>&1 | tail -n 1 | grep -v -e'+')" # Empty if there are no commits to fetch
localStatus="$(git push -n --porcelain | grep -e'up to date')" # Empty if there are commits to push localStatus="$(git push -n --porcelain | grep -e'up to date')" # Empty if there are commits to push
{ output=$(
if [ -z "$remoteStatus" ]; then if [ -z "$remoteStatus" ]; then
if [ -z "$localStatus" ]; then if [ -z "$localStatus" ]; then
echo "Pushing "$GIT_REPO" updates to origin" echo "Pushing "$GIT_REPO" updates to origin"
@ -64,7 +64,11 @@ for GIT_REPO in $work_array ; do
git remote update 2>&1 git remote update 2>&1
exit 1 exit 1
fi fi
fi } | wall fi )
if [ ! -z "$output" ]; then
echo "$output" | wall
fi
done done

View file

@ -4,4 +4,4 @@ Description=Updates git repos
[Service] [Service]
Type=oneshot Type=oneshot
User=intech User=intech
ExecStart=/bin/bash ~/git_repos/gitUpdate.sh "/home/intech/git_repos/TechTheTachyon-HighLevel.git" "/home/intech/git_repos/TechTheTachyon-LowLevel.git" ExecStart=/bin/bash /home/intech/git_repos/gitUpdate.sh "/home/intech/git_repos/TechTheTachyon-HighLevel.git" "/home/intech/git_repos/TechTheTachyon-LowLevel.git"