narcissus/sync.sh
Nicolás Ortega Froysa 9476cea22e Enable comments in repo list file.
Signed-off-by: Nicolás Ortega Froysa <nicolas@ortegas.org>
2024-05-01 10:37:20 +02:00

29 lines
370 B
Bash
Executable File

#!/bin/bash
while read line
do
if [[ -z "$line" || "$line" == "#"* ]]
then
continue
fi
ORIG=$(echo $line | cut -d ';' -f1)
DEST=$(echo $line | cut -d ';' -f2)
NAME=${ORIG##*/}
echo "Mirroring $NAME"
if [ -d "$NAME" ]
then
rm -r $NAME
fi
git clone --mirror $ORIG
cd $NAME
git push --mirror $DEST
cd ..
rm -r $NAME
echo "Done."
done <./repo-list