Files
zShared/sbin/GitPull
USER b07500108e .
2023-09-25 21:43:01 +01:00

44 lines
563 B
Bash
Executable File

#!/bin/sh
#
echo "SCRIPT $0 starting"
MYNAME=`uname -n`
pull_repo () {
for i in `ls -d ${ZZ}`
do
echo "checking $i"
if [ -d $i/.git ]
then
echo "pulling $i"
(cd $i; git pull; git checkout main; git pull )
fi
done
}
if [ $USER == root ]
then
ZZ=/zz/*
pull_repo
fi
#for i in `ls ${ZZ}`
#do
# echo $i
# if [ -d ${ZZ}/$i/.git ]
# then
# echo $i
# (cd ${ZZ}/$i; git pull; git checkout main; git pull )
# fi
#done
ZZ=~/git/private/z*
pull_repo
ZZ=~/git/public/z*
pull_repo
exit 0