diff --git a/docker-install.sh b/docker-install.sh index 42d918e..f4aed3f 100755 --- a/docker-install.sh +++ b/docker-install.sh @@ -7,12 +7,12 @@ echo "=== Choose docker source (a: 阿里云, z: 中科大, leave blank for default):" read -p ">>> " DOCKER_SOURCE -if [ $DOCKER_SOURCE = 'a' ] +if [ "$DOCKER_SOURCE" = 'a' ] then GPG_URL=http://mirrors.aliyun.com/docker-ce/linux/debian/gpg DOCKER_URL=http://mirrors.aliyun.com/docker-ce/linux/debian COMPOSE_URL=https://get.daocloud.io/docker/compose/releases/download/1.29.2/ -elif [ $DOCKER_SOURCE = 'z' ] +elif [ "$DOCKER_SOURCE" = 'z' ] then GPG_URL=https://mirrors.ustc.edu.cn/docker-ce/linux/debian/gpg DOCKER_URL=https://mirrors.ustc.edu.cn/docker-ce/linux/debian @@ -43,21 +43,21 @@ sudo chmod +x /usr/local/bin/docker-compose echo "=== 配置中国加速镜像源 /etc/docker/daemon.json (d: Docker中国, t: 腾讯云, z: 中科大, leave blank for no mirror):" read -p ">>> " DOCKER_MIRROR -if [ ! $DOCKER_MIRROR ] +if [ ! "$DOCKER_MIRROR" ] then echo "--- Docker mirror is not specified." -elif [ $DOCKER_MIRROR = 'd' ] +elif [ "$DOCKER_MIRROR" = 'd' ] then DOCKER_MIRROR=https://registry.docker-cn.com -elif [ $DOCKER_MIRROR = 't' ] +elif [ "$DOCKER_MIRROR" = 't' ] then DOCKER_MIRROR=https://mirror.ccs.tencentyun.com -elif [ $DOCKER_MIRROR = 'z' ] +elif [ "$DOCKER_MIRROR" = 'z' ] then DOCKER_MIRROR=https://docker.mirrors.ustc.edu.cn fi -if [ $DOCKER_MIRROR ] +if [ "$DOCKER_MIRROR" ] then echo "{" | sudo tee /etc/docker/daemon.json > /dev/null echo " \"registry-mirrors\": [" | sudo tee -a /etc/docker/daemon.json > /dev/null @@ -68,7 +68,7 @@ fi echo "=== 启动docker服务?y for yes, anything else for no" read -p ">>> " StartDockerDaemon -if [ $StartDockerDaemon ] && [ $StartDockerDaemon = 'y' ] +if [ "$StartDockerDaemon" = 'y' ] then # 开机启动 sudo systemctl enable docker diff --git a/git-clone-all.sh b/git-clone-all.sh index 9a68f0c..155de45 100755 --- a/git-clone-all.sh +++ b/git-clone-all.sh @@ -2,122 +2,106 @@ mkdir cup pushd cup -git clone https://git.faronear.org/cup/gasj-allinone -git clone https://git.faronear.org/cup/gdthomas-web-jp -git clone https://git.faronear.org/cup/cmc-user-uniapp -git clone https://git.faronear.org/cup/cmc-server-torm +git clone https://git.faronear.org/cup/cmc-user-uniapp cmc-user-uniapp.git +git clone https://git.faronear.org/cup/cmc-server-torm cmc-server-torm.git popd mkdir fon pushd fon -git clone https://git.faronear.org/npm/sysconfig -git clone https://git.faronear.org/fon/dot.vscode -git clone https://git.faronear.org/fon/www.faronear.com -git clone https://git.faronear.org/fon/yapi.faronear.org -git clone https://git.faronear.org/fon/git.faronear.org -git clone https://git.faronear.org/fon/www.faronear.org -git clone https://git.faronear.org/fon/mail.faronear.org +git clone https://git.faronear.org/npm/sysconfig sysconfig.git +git clone https://git.faronear.org/fon/dot.vscode dot.vscode.git +git clone https://git.faronear.org/fon/www.faronear.com www.faronear.com.git +git clone https://git.faronear.org/fon/yapi.faronear.org yapi.faronear.org.git +git clone https://git.faronear.org/fon/git.faronear.org git.faronear.org.git +git clone https://git.faronear.org/fon/www.faronear.org www.faronear.org.git +git clone https://git.faronear.org/fon/mail.faronear.org mail.faronear.org.git popd mkdir npm pushd npm -git clone https://git.faronear.org/npm/wo-base-fileloader -git clone https://git.faronear.org/npm/wo-base-deployer -git clone https://git.faronear.org/npm/wo-base-envar -git clone https://git.faronear.org/npm/wo-base-cocon -git clone https://git.faronear.org/npm/wo-base-messenger -git clone https://git.faronear.org/npm/wo-base-netinfo -git clone https://git.faronear.org/npm/wo-base-webserver -git clone https://git.faronear.org/npm/wo-base-websocket-server -git clone https://git.faronear.org/npm/wo-base-webtoken +git clone https://git.faronear.org/npm/wo-base-fileloader wo-base-fileloader.git +git clone https://git.faronear.org/npm/wo-base-deployer wo-base-deployer.git +git clone https://git.faronear.org/npm/wo-base-envar wo-base-envar.git +git clone https://git.faronear.org/npm/wo-base-cocon wo-base-cocon.git +git clone https://git.faronear.org/npm/wo-base-messenger wo-base-messenger.git +git clone https://git.faronear.org/npm/wo-base-netinfo wo-base-netinfo.git +git clone https://git.faronear.org/npm/wo-base-webserver wo-base-webserver.git +git clone https://git.faronear.org/npm/wo-base-websocket-server wo-base-websocket-server.git +git clone https://git.faronear.org/npm/wo-base-webtoken wo-base-webtoken.git -git clone https://git.faronear.org/npm/wo-core-i18n -git clone https://git.faronear.org/npm/wo-core-toolkit -git clone https://git.faronear.org/npm/wo-core-rpcsocket +git clone https://git.faronear.org/npm/wo-core-i18n wo-core-i18n.git +git clone https://git.faronear.org/npm/wo-core-toolkit wo-core-toolkit.git +git clone https://git.faronear.org/npm/wo-core-rpcsocket wo-core-rpcsocket.git -git clone https://git.faronear.org/npm/wo-user-part-uniapp -git clone https://git.faronear.org/npm/wo-user-style-scss -git clone https://git.faronear.org/npm/wo-user-toolkit-uniapp -git clone https://git.faronear.org/npm/wo-user-websocket-uniapp +git clone https://git.faronear.org/npm/wo-user-part-uniapp wo-user-part-uniapp.git +git clone https://git.faronear.org/npm/wo-user-style-scss wo-user-style-scss.git +git clone https://git.faronear.org/npm/wo-user-toolkit-uniapp wo-user-toolkit-uniapp.git +git clone https://git.faronear.org/npm/wo-user-websocket-uniapp wo-user-websocket-uniapp.git -git clone https://git.faronear.org/npm/tic-crypto -git clone https://git.faronear.org/npm/tic-chaintool -git clone https://git.faronear.org/npm/tic-traction +git clone https://git.faronear.org/npm/tic-crypto tic-crypto.git +git clone https://git.faronear.org/npm/tic-chaintool tic-chaintool.git +git clone https://git.faronear.org/npm/tic-traction tic-traction.git -git clone https://git.faronear.org/npm/vue-cli-uniapp +git clone https://git.faronear.org/npm/vue-cli-uniapp vue-cli-uniapp.git popd mkdir sol pushd sol -git clone https://git.faronear.org/sol/sol-ling -git clone https://git.faronear.org/sol/sol-data -git clone https://git.faronear.org/sol/sol-base -git clone https://git.faronear.org/sol/solet -git clone https://git.faronear.org/sol/soweb -popd - -mkdir tex -pushd tex -git clone https://git.faronear.org/tex/tex-basebank-java -git clone https://git.faronear.org/tex/tex-baserver-java -git clone https://git.faronear.org/tex/tex-doc -git clone https://git.faronear.org/tex/tex-team-vue -git clone https://git.faronear.org/tex/tex-user-android -git clone https://git.faronear.org/tex/tex-user-ios -git clone https://git.faronear.org/tex/tex-user-vue +git clone https://git.faronear.org/sol/sol-ling sol-ling.git +git clone https://git.faronear.org/sol/sol-data sol-data.git +git clone https://git.faronear.org/sol/sol-base sol-base.git +git clone https://git.faronear.org/sol/solet solet.git +git clone https://git.faronear.org/sol/soweb soweb.git popd mkdir tic pushd tic -git clone https://git.faronear.org/tic/cloud-server -git clone https://git.faronear.org/tic/cloud-user-vue -git clone https://git.faronear.org/tic/star-core-torm -git clone https://git.faronear.org/tic/star-lens-uniapp -git clone https://git.faronear.org/tic/star-lens-vue -git clone https://git.faronear.org/tic/tic-blog-hexo -git clone https://git.faronear.org/tic/tic-www-vue +git clone https://git.faronear.org/tic/cloud-server cloud-server.git +git clone https://git.faronear.org/tic/cloud-user-vue cloud-user-vue.git +git clone https://git.faronear.org/tic/star-core-torm star-core-torm.git +git clone https://git.faronear.org/tic/star-lens-uniapp star-lens-uniapp.git +git clone https://git.faronear.org/tic/star-lens-vue star-lens-vue.git +git clone https://git.faronear.org/tic/tic-blog-hexo tic-blog-hexo.git +git clone https://git.faronear.org/tic/tic-www-vue tic-www-vue.git + +git clone https://git.faronear.org/tex/tex-basebank-java tex-basebank-java.git +git clone https://git.faronear.org/tex/tex-baserver-java tex-baserver-java.git +git clone https://git.faronear.org/tex/tex-team-vue tex-team-vue.git +git clone https://git.faronear.org/tex/tex-user-android tex-user-android.git +git clone https://git.faronear.org/tex/tex-user-ios tex-user-ios.git +git clone https://git.faronear.org/tex/tex-user-vue tex-user-vue.git + popd mkdir tuc pushd tuc -git clone https://git.faronear.org/tuc/tisch -git clone https://git.faronear.org/tuc/nesh -git clone https://git.faronear.org/tuc/nbtc -popd -mkdir tuc-pex -pushd tuc-pex -git clone https://git.faronear.org/tuc-pex/pex-blog-hexo -git clone https://git.faronear.org/tuc-pex/pex-server-torm -git clone https://git.faronear.org/tuc-pex/pex-user-uniapp -popd +git clone https://git.faronear.org/tuc/tisch fork/tisch.git +git clone https://git.faronear.org/tuc/nesh fork/nesh.git +git clone https://git.faronear.org/tuc/nbtc fork/nbtc.git -mkdir tuc-log -pushd tuc-log -git clone https://git.faronear.org/tuc-log/log-team-uniapp -git clone https://git.faronear.org/tuc-log/log-server-mongo -git clone https://git.faronear.org/tuc-log/log-server-torm -git clone https://git.faronear.org/tuc-log/log-user-react -git clone https://git.faronear.org/tuc-log/log-user-uniapp -git clone https://git.faronear.org/tuc-log/log-user-vue -git clone https://git.faronear.org/tuc-log/log-blog-hexo -popd +git clone https://git.faronear.org/tuc-pex/pex-blog-hexo pex/pex-blog-hexo.git +git clone https://git.faronear.org/tuc-pex/pex-chain-geth pex/pex-chain-geth.git +git clone https://git.faronear.org/tuc-pex/pex-contract-hardhat pex/pex-contract-hardhat.git +git clone https://git.faronear.org/tuc-pex/pex-server-torm pex/pex-server-torm.git +git clone https://git.faronear.org/tuc-pex/pex-user-uniapp pex/pex-user-uniapp.git +git clone https://git.faronear.org/tuc-log/log-team-uniapp log/log-team-uniapp.git +git clone https://git.faronear.org/tuc-log/log-server-mongo log/log-server-mongo.git +git clone https://git.faronear.org/tuc-log/log-server-torm log/log-server-torm.git +git clone https://git.faronear.org/tuc-log/log-user-react log/log-user-react.git +git clone https://git.faronear.org/tuc-log/log-user-uniapp log/log-user-uniapp.git +git clone https://git.faronear.org/tuc-log/log-user-vue log/log-user-vue.git +git clone https://git.faronear.org/tuc-log/log-blog-hexo log/log-blog-hexo.git -mkdir tuc-vic -pushd tuc-vic -git clone https://git.faronear.org/tuc-vic/vic -git clone https://git.faronear.org/tuc-vic/vic.server.mongo -git clone https://git.faronear.org/tuc-vic/vic.user.react -git clone https://git.faronear.org/tuc-vic/vic.webhome.hexo -git clone https://git.faronear.org/tuc-vic/vic.market -git clone https://git.faronear.org/tuc-vic/vic.admin.vue -popd +git clone https://git.faronear.org/tuc-vic/vic.server.mongo vic/vic.server.mongo.git +git clone https://git.faronear.org/tuc-vic/vic.user.react vic/vic.user.react.git +git clone https://git.faronear.org/tuc-vic/vic.webhome.hexo vic/vic.webhome.hexo.git +git clone https://git.faronear.org/tuc-vic/vic.market vic/vic.market.git +git clone https://git.faronear.org/tuc-vic/vic.admin.vue vic/vic.admin.vue.git + +git clone https://git.faronear.org/tuc-fiv/fiv.webhome.hexo fiv.webhome.hexo.git +git clone https://git.faronear.org/tuc-fiv/fiv.server.mongo fiv.server.mongo.git +git clone https://git.faronear.org/tuc-fiv/fiv.user.react fiv.user.react.git -mkdir tuc-fiv -pushd tuc-fiv -git clone https://git.faronear.org/tuc-fiv/fiv -git clone https://git.faronear.org/tuc-fiv/fiv.webhome.hexo -git clone https://git.faronear.org/tuc-fiv/fiv.server.mongo -git clone https://git.faronear.org/tuc-fiv/fiv.user.react popd diff --git a/git-pull-all.sh b/git-pull-all.sh index ce0f59e..8754c60 100755 --- a/git-pull-all.sh +++ b/git-pull-all.sh @@ -1,25 +1,32 @@ #!/bin/bash -if [ $1 ] +testpath1=/faronear +testpath2=~/faronear +testpath3=/mnt/d/faronear + +if [ "$1" ] then FONPATH=$1 -elif [ -d /faronear ] +elif [ -d $testpath1 ] then - FONPATH=/faronear -elif [ -d ~/faronear ] + FONPATH=$testpath1 +elif [ -d $testpath2 ] then - FONPATH=~/faronear + FONPATH=$testpath2 +elif [ -d $testpath3 ] +then + FONPATH=$testpath3 else echo "=== Enter [target path] or leave [blank] for default to `.`" read -p ">>> " FONPATH echo "" - if [ ! $FONPATH ] + if [ ! "$FONPATH" ] then FONPATH=. fi fi -if [ ! -d $FONPATH ] +if [ ! -d "$FONPATH" ] then echo "*** [$FONPATH] not exist! Exit now. ***" exit diff --git a/git-pull-recursive.sh b/git-pull-recursive.sh index ff6125c..a4d4171 100644 --- a/git-pull-recursive.sh +++ b/git-pull-recursive.sh @@ -1,28 +1,32 @@ #!/bin/bash -if [ $1 ] +testpath1=/faronear +testpath2=~/faronear +testpath3=/mnt/d/faronear + +if [ "$1" ] then FONPATH=$1 -elif [ -d /faronear ] +elif [ -d $testpath1 ] then - FONPATH=/faronear -elif [ -d ~/faronear ] + FONPATH=$testpath1 +elif [ -d $testpath2 ] then - FONPATH=~/faronear -elif [ -d /mnt/d/faronear ] + FONPATH=$testpath2 +elif [ -d $testpath3 ] then - FONPATH=/mnt/d/faronear + FONPATH=$testpath3 else echo "=== Enter [target path] or leave [blank] for default to `.`" read -p ">>> " FONPATH echo "" - if [ ! $FONPATH ] + if [ ! "$FONPATH" ] then FONPATH=. fi fi -if [ ! -d $FONPATH ] +if [ ! -d "$FONPATH" ] then echo "*** [$FONPATH] not exist! Exit now. ***" exit diff --git a/git-push-all.sh b/git-push-all.sh index 37947f6..1e5e023 100755 --- a/git-push-all.sh +++ b/git-push-all.sh @@ -1,25 +1,32 @@ #!/bin/bash -if [ $1 ] +testpath1=/faronear +testpath2=~/faronear +testpath3=/mnt/d/faronear + +if [ "$1" ] then FONPATH=$1 -elif [ -d /faronear ] +elif [ -d $testpath1 ] then - FONPATH=/faronear -elif [ -d ~/faronear ] + FONPATH=$testpath1 +elif [ -d $testpath2 ] then - FONPATH=~/faronear + FONPATH=$testpath2 +elif [ -d $testpath3 ] +then + FONPATH=$testpath3 else echo "=== Enter [target path] or leave [blank] for default to `.`" read -p ">>> " FONPATH echo "" - if [ ! $FONPATH ] + if [ ! "$FONPATH" ] then FONPATH=. fi fi -if [ ! -d $FONPATH ] +if [ ! -d "$FONPATH" ] then echo "*** [$FONPATH] not exist! Exit now. ***" exit diff --git a/git-rename-branch.sh b/git-rename-branch.sh index f2005df..3b79bca 100755 --- a/git-rename-branch.sh +++ b/git-rename-branch.sh @@ -1,26 +1,32 @@ #!/bin/bash -if [ $1 ] +testpath1=/faronear +testpath2=~/faronear +testpath3=/mnt/d/faronear + +if [ "$1" ] then FONPATH=$1 +elif [ -d $testpath1 ] +then + FONPATH=$testpath1 +elif [ -d $testpath2 ] +then + FONPATH=$testpath2 +elif [ -d $testpath3 ] +then + FONPATH=$testpath3 else - echo Leave blank for default [/faronear], [~/faronear], [.], - read -p "or enter faronear path to git pull >> " FONPATH - if [ ! $FONPATH ] + echo "=== Enter [target path] or leave [blank] for default to `.`" + read -p ">>> " FONPATH + echo "" + if [ ! "$FONPATH" ] then - if [ -d /faronear ] - then - FONPATH=/faronear - elif [ -d ~/faronear ] - then - FONPATH=~/faronear - else - FONPATH=. - fi + FONPATH=. fi fi -if [ ! -d $FONPATH ] +if [ ! -d "$FONPATH" ] then echo "*** [$FONPATH] not exist! Exit now. ***" exit @@ -28,31 +34,33 @@ fi pushd $FONPATH echo "*** Current path = [`pwd`] ***" -for org in '*' +echo "" + +# for org in `ls -F | grep '/$' | grep -v '~'` ## 首先过滤出所有子目录,然后过滤出所有不含 ~ 的子目录。注意 for ??? in `ls ???` 是按照空行以及空格进行分割的,因此最后筛选出的目录名不能含有空格,否则就被分割成多个了。 +ls -F | grep '/$' | grep -v '=' | while read org ## 换用这种方法,可以成功过滤出含有空格的完整目录名 do - if [ -d $org ] - then - echo " entering [$FONPATH/$org]" - cd $org; - for repo in * - do - if [ -d $repo/.git ] - then - cd $repo - # echo " changing repo url to [$FONPATH/$org/$repo]" - # git remote remove origin - # git remote add origin https://git.faronear.org/$org/$repo - # git pull - # git branch --set-upstream-to=origin/main main - # git pull - echo " renaming master branch to main" - git branch -m master main - git push -u origin main - git push origin :master - cd .. - fi - done - cd ..; - fi + echo "======== entering [$FONPATH/$org] ========" + echo "" + cd "$org"; + for repo in * ## for ??? in * 是分割成一个个目录名的,即使目录名含有空格 + do + if [ -d "$repo/.git" ] + then + cd "$repo" + # echo " changing repo url to [$FONPATH/$org/$repo]" + # git remote remove origin + # git remote add origin https://git.faronear.org/$org/$repo + # git pull + # git branch --set-upstream-to=origin/main main + # git pull + echo "---- renaming branch master to main for [`pwd`/$repo] ----" + git branch -m master main + git push -u origin main + git push origin :master + echo "" + cd .. + fi + done + cd .. done popd diff --git a/home-config.sh b/home-config.sh index 5a54281..4aeed03 100755 --- a/home-config.sh +++ b/home-config.sh @@ -1,40 +1,45 @@ #!/bin/bash -if [ $1 ] +testpath1=/faronear/fon/sysconfig/nixhome +testpath2=~/faronear/fon/sysconfig/nixhome +testpath3=~/faronear/fon/sysconfig.git/nixhome +testpath4=`pwd`/nixhome + +if [ "$1" ] then SourcePath=$1 +elif [ -d $testpath1 ] +then + SourcePath=$testpath1 +elif [ -d $testpath2 ] +then + SourcePath=$testpath2 +elif [ -d $testpath3 ] +then + SourcePath=$testpath3 +elif [ -d $testpath4 ] +then + SourcePath=$testpath4 else - echo "Configure private home settings" - echo "Usage: setup.sh [Config-Source-Path] [User-Home-Path] [--AdotMode]" - echo - echo "=== Enter config <> or leave <> for [/Users/luk.lu]/faronear/fon/sysconfig/nixhome):" + echo "=== Enter [target path] or leave [blank] to exit" read -p ">>> " SourcePath - if [ ! $SourcePath ] - then - echo "Use default source path: [Users/luk.lu]/faronear/fon/sysconfig/nixhome" - echo - if [ -d /faronear/fon/sysconfig/nixhome ] - then - SourcePath=/faronear/fon/sysconfig/nixhome - else - if [ -d /Users/luk.lu/faronear/fon/sysconfig/nixhome ] - then - SourcePath=/Users/luk.lu/faronear/fon/sysconfig/nixhome - else - SourcePath=`pwd`/nixhome - fi - fi + echo "" + if [ ! -d "$SourcePath" ] + then + echo "*** Source path [$SourcePath] not available! Exit now. ***" + exit fi fi -if [ $2 ] + +if [ "$2" ] then HomePath=$2 else HomePath=~ fi -if [ -d $SourcePath ] && [ -d $HomePath ] +if [ -d $HomePath ] then pushd $HomePath homescriptlist=".emacs .emacs.lisp .bashrc .bash_profile .gitignore" @@ -44,7 +49,7 @@ then for homescript in $homescriptlist do mv $homescript $homescript.backup-[$(date +%Y%m%d-%H%M%S)] - if [ $CopyOrLinkScripts = 'l' ] + if [ "$CopyOrLinkScripts" = 'l' ] then echo "--- Linking $SourcePath/$homescript to $HomePath/$homescript ..." ln -s $SourcePath/$homescript $HomePath @@ -54,20 +59,20 @@ then fi done echo - echo "=== Append or link or omit [.ssh/authorized_keys]? for append, for link, <> for omit:" + echo "=== Append or link or omit [.ssh/authorized_keys] to config ssh server? for append, for link, <> for omit:" read -p ">>> " CopyOrLinkOrOmitAuthorizedKeys - if [ $CopyOrLinkOrOmitAuthorizedKeys = 'l' ] + if [ "$CopyOrLinkOrOmitAuthorizedKeys" = 'l' ] then echo "--- Linking $SourcePath/authorized_keys to $HomePath/.ssh/authorized_keys ..." mkdir -p $HomePath/.ssh chmod 700 $HomePath/.ssh mv $HomePath/.ssh/authorized_keys $HomePath/.ssh/authorized_keys.backup-[$(date +%Y%m%d-%H%M%S)] ln -s $SourcePath/.ssh/authorized_keys $HomePath/.ssh/authorized_keys - elif [ $CopyOrLinkOrOmitAuthorizedKeys = 'a' ] + elif [ "$CopyOrLinkOrOmitAuthorizedKeys" = 'a' ] then mkdir -p $HomePath/.ssh chmod 700 $HomePath/.ssh - if [ -L $HomePath/.ssh/authorized_keys ] + if [ -L '$HomePath/.ssh/authorized_keys' ] then mv $HomePath/.ssh/authorized_keys $HomePath/.ssh/authorized_keys.backup fi @@ -77,7 +82,7 @@ then echo popd else - echo "!!! Not existing $SourcePath or $HomePath, please try again." + echo "!!! Not existing $HomePath, please try again." fi echo "=== Sourcing $HomePath/.bashrc ..." diff --git a/nixhome/.bashrc b/nixhome/.bashrc index ca50465..eb819de 100644 --- a/nixhome/.bashrc +++ b/nixhome/.bashrc @@ -99,18 +99,30 @@ fi export USERPROFILE=$HOME # add sysconfig to path -if [ -d /Users/luk.lu/faronear/fon/sysconfig ] +tp1=/Users/luk.lu/faronear/fon/sysconfig +tp2=/Users/luk.lu/faronear/fon/sysconfig.git +tp3=/faronear/fon/sysconfig +tp4=/faronear/fon/sysconfig.git +tp5=/mnt/c/faronear/fon/sysconfig.git +tp6=/mnt/d/faronear/fon/sysconfig.git +if [ -d $tp1 ] then - export PATH=/Users/luk.lu/faronear/fon/sysconfig:$PATH -elif [ -d /Users/luk.lu/faronear/fon/sysconfig.git ] + export PATH=$tp1:$PATH +elif [ -d $tp2 ] then - export PATH=/Users/luk.lu/faronear/fon/sysconfig.git:$PATH -elif [ -d /faronear/fon/sysconfig ] + export PATH=$tp2:$PATH +elif [ -d $tp3 ] then - export PATH=/faronear/fon/sysconfig:$PATH -elif [ -d /faronear/fon/sysconfig.git ] + export PATH=$tp3:$PATH +elif [ -d $tp4 ] then - export PATH=/faronear/fon/sysconfig.git:$PATH + export PATH=$tp4:$PATH +elif [ -d $tp5 ] +then + export PATH=$tp5:$PATH +elif [ -d $tp6 ] +then + export PATH=$tp6:$PATH fi if [ -f ~/.bashrc_custom ] diff --git a/npm-boot-all.sh b/npm-boot-all.sh index 0236dce..b73b88a 100755 --- a/npm-boot-all.sh +++ b/npm-boot-all.sh @@ -1,25 +1,32 @@ #!/bin/bash -if [ $1 ] +testpath1=/faronear +testpath2=~/faronear +testpath3=/mnt/d/faronear + +if [ "$1" ] then FONPATH=$1 -elif [ -d /faronear ] +elif [ -d $testpath1 ] then - FONPATH=/faronear -elif [ -d ~/faronear ] + FONPATH=$testpath1 +elif [ -d $testpath2 ] then - FONPATH=~/faronear + FONPATH=$testpath2 +elif [ -d $testpath3 ] +then + FONPATH=$testpath3 else echo "=== Enter [target path] or leave [blank] for default to `.`" read -p ">>> " FONPATH echo "" - if [ ! $FONPATH ] + if [ ! "$FONPATH" ] then FONPATH=. fi fi -if [ ! -d $FONPATH ] +if [ ! -d "$FONPATH" ] then echo "*** [$FONPATH] not exist! Exit now. ***" exit diff --git a/npm-boot-recursive.sh b/npm-boot-recursive.sh index b21d613..2456ae4 100644 --- a/npm-boot-recursive.sh +++ b/npm-boot-recursive.sh @@ -1,28 +1,32 @@ #!/bin/bash -if [ $1 ] +testpath1=/faronear +testpath2=~/faronear +testpath3=/mnt/d/faronear + +if [ "$1" ] then FONPATH=$1 -elif [ -d /faronear ] +elif [ -d $testpath1 ] then - FONPATH=/faronear -elif [ -d ~/faronear ] + FONPATH=$testpath1 +elif [ -d $testpath2 ] then - FONPATH=~/faronear -elif [ -d /mnt/d/faronear ] + FONPATH=$testpath2 +elif [ -d $testpath3 ] then - FONPATH=/mnt/d/faronear + FONPATH=$testpath3 else echo "=== Enter [target path] or leave [blank] for default to `.`" read -p ">>> " FONPATH echo "" - if [ ! $FONPATH ] + if [ ! "$FONPATH" ] then FONPATH=. fi fi -if [ ! -d $FONPATH ] +if [ ! -d "$FONPATH" ] then echo "*** [$FONPATH] not exist! Exit now. ***" exit