Files
narcissus/sync.sh
T

30 lines
382 B
Bash
Raw Normal View History

2024-05-01 10:21:28 +02:00
#!/bin/bash
while read line
do
2024-05-01 10:37:20 +02:00
if [[ -z "$line" || "$line" == "#"* ]]
then
continue
fi
2024-05-01 10:21:28 +02:00
ORIG=$(echo $line | cut -d ';' -f1)
DEST=$(echo $line | cut -d ';' -f2)
NAME=${ORIG##*/}
echo "Mirroring $NAME"
if [ -d "$NAME" ]
then
2024-05-01 10:54:26 +02:00
cd $NAME
git remote update
else
git clone --mirror $ORIG
cd $NAME
2024-05-01 10:21:28 +02:00
fi
git push --mirror $DEST
cd ..
2024-05-01 10:25:53 +02:00
echo "Done."
2024-05-01 10:21:28 +02:00
done <./repo-list