Compare commits
No commits in common. "f0a723e35eab294302c9684a4ca234f26d2f1d5b" and "746970f1ff7c551113afd4c0e518f684e7b399fd" have entirely different histories.
f0a723e35e
...
746970f1ff
@ -1,54 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
if [ $1 ]
|
|
||||||
then
|
|
||||||
FONPATH=$1
|
|
||||||
else
|
|
||||||
echo Leave blank for default [/faronear], [~/faronear], [.],
|
|
||||||
read -p "or enter faronear path to git push >> " FONPATH
|
|
||||||
if [ ! $FONPATH ]
|
|
||||||
then
|
|
||||||
if [ -d /faronear ]
|
|
||||||
then
|
|
||||||
FONPATH=/faronear
|
|
||||||
else
|
|
||||||
if [ -d ~/faronear ]
|
|
||||||
then
|
|
||||||
FONPATH=~/faronear
|
|
||||||
else
|
|
||||||
FONPATH=.
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -d $FONPATH ]
|
|
||||||
then
|
|
||||||
echo "*** [$FONPATH] not exist! Exit now. ***"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
pushd $FONPATH
|
|
||||||
echo "*** Current path = [`pwd`] ***"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
# for org in `ls -F | grep '/$' | grep -v '~'` ## 首先过滤出所有子目录,然后过滤出所有不含 ~ 的子目录。注意 for ??? in `ls ???` 是按照空行以及空格进行分割的,因此最后筛选出的目录名不能含有空格,否则就被分割成多个了。
|
|
||||||
ls -F | grep '/$' | grep -v '=' | while read org ## 换用这种方法,可以成功过滤出含有空格的完整目录名
|
|
||||||
do
|
|
||||||
echo "======== entering [$FONPATH/$org] ========"
|
|
||||||
echo ""
|
|
||||||
cd "$org";
|
|
||||||
for repo in * ## for ??? in * 是分割成一个个目录名的,即使目录名含有空格
|
|
||||||
do
|
|
||||||
if [ -d "$repo/.git" ]
|
|
||||||
then
|
|
||||||
echo "---- git pushing [`pwd`/$repo] ----"
|
|
||||||
cd "$repo"
|
|
||||||
git push
|
|
||||||
echo ""
|
|
||||||
cd ..
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
cd ..
|
|
||||||
done
|
|
||||||
popd
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
echo "in [RepoRoot]/*/*/hooks/[pre|update|post]-receive.d/*, path is hard-coded in full such as `/faronear/git/gitea/custom/conf/app.ini`, you need to replace it if the path is changed."
|
echo "in [RepoRoot]/*/*/hooks/post-receive & pre-receive, gogs is hard-coded with full path such as /faronear/git/gogs, you need to replace it if the path is changed."
|
||||||
read -p "Enter old hook path: >> " OLDPATH
|
read -p "Enter old hook path: >> " OLDPATH
|
||||||
read -p "Enter new hook path: >> " NEWPATH
|
read -p "Enter new hook path: >> " NEWPATH
|
||||||
read -p "Enter repository root path: >> " REPOROOT
|
read -p "Enter repository root path: >> " REPOROOT
|
||||||
@ -13,6 +13,3 @@ get_char()
|
|||||||
|
|
||||||
echo "Press any key to exit!"
|
echo "Press any key to exit!"
|
||||||
char=`get_char`
|
char=`get_char`
|
||||||
|
|
||||||
# read -p "press Enter to exit!"
|
|
||||||
# echo "Bye!"
|
|
||||||
22
proxy.sh
22
proxy.sh
@ -1,22 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
function proxy(){
|
|
||||||
echo "=== 开启或关闭网络代理? u for up, d for down, anything else for no change."
|
|
||||||
read -p ">>> " proxySwitch
|
|
||||||
if [ $proxySwitch ] && [ $proxySwitch == "u" ]
|
|
||||||
then
|
|
||||||
export ALL_PROXY=socks5://127.0.0.1:1090
|
|
||||||
export http_proxy=http://127.0.0.1:41091
|
|
||||||
export https_proxy=https://127.0.0.1:41091
|
|
||||||
echo -e "--- 已开启网络代理"
|
|
||||||
elif [ $proxySwitch ] && [ $proxySwitch == "d" ]
|
|
||||||
then
|
|
||||||
unset ALL_PROXY
|
|
||||||
unset http_proxy
|
|
||||||
unset https_proxy
|
|
||||||
echo -e "--- 已关闭网络代理"
|
|
||||||
else
|
|
||||||
echo "--- Nothing changed."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
proxy
|
|
||||||
Loading…
Reference in New Issue
Block a user