diff --git a/bin/repo-move.sh b/bin/repo-move.sh new file mode 100755 index 0000000..da47054 --- /dev/null +++ b/bin/repo-move.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +GITHUB=https://github.com/nprobert +PSTAR=https://www.probestar.com/NTCNA-TP + +for i in * +do + echo "$i: " + if [ -d $i ]; then + cd $i + git ls-remote --get-url | grep www.probestar.com + if [ "$?" -eq "0" ]; then + cd .. + continue + fi + cd .. + fi + if [ ! -d $i.git ]; then + git clone --mirror $GITHUB/$i.git + cd $i.git + git remote add new $PSTAR/$i.git + git push --mirror new + cd .. + rm -rf $i.git + fi + if [ -d $i ]; then + cd $i + git remote set-url origin $PSTAR/$i.git + git pull --recurse-submodules + cd .. + else + git clone $PSTAR/$i.git --recursive + fi +done diff --git a/bin/repo-update.sh b/bin/repo-update.sh new file mode 100755 index 0000000..7315beb --- /dev/null +++ b/bin/repo-update.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +PSTAR=https://www.probestar.com/PStar + +for i in * +do + if [ -d $i ]; then + cd $i + git remote set-url origin $PSTAR/$i.git + git pull --recurse-submodules + cd .. + else + git clone $PSTAR/$i.git --recursive + fi +done