#!/bin/bash FONPATH1=/faronear FONPATH2=~/faronear.git FONPATH3=~/faronear FONPATH4=/mnt/d/faronear echo "*** Testing [$1] [$FONPATH1] [$FONPATH2] [$FONPATH3] [$FONPATH4]" if [ "$1" ] then FONPATH=$1 elif [ -d $FONPATH1 ] then FONPATH=$FONPATH1 elif [ -d $FONPATH2 ] then FONPATH=$FONPATH2 elif [ -d $FONPATH3 ] then FONPATH=$FONPATH3 elif [ -d $FONPATH4 ] then FONPATH=$FONPATH4 else echo "××× All testing path failed." echo "" echo "=== Enter [fonpath] or leave [blank] for default to '.'" read -p ">>> " FONPATH echo "" if [ ! "$FONPATH" ] then FONPATH=. fi fi if [ ! -d "$FONPATH" ] then echo "××× [$FONPATH] not exist! Exit now. ***" exit else echo "√√√ FONPATH = $FONPATH" fi cd $FONPATH echo "*** Starting from [`pwd`] ***" echo "" echo "=== Enter [path-to-seafile-ignore.txt]" read -p ">>> " SFIGNOREPATH echo "" if [ ! -f "$SFIGNOREPATH/seafile-ignore.txt" ] then echo "××× Not existed [$SFIGNOREPATH/seafile-ignore.txt]. Exit now..." exit fi find . -mindepth 1 -maxdepth 3 -type d -name '[^.]*' | grep -E -v 'node_modules uni_modules .deploy_git .git .svn .vscode unpackage _webroot _logstore _datasotre _archive _filestore _ssl' | while read repo do if [ -d "$repo/.git" ] then echo "---- updating seafile-ignore.txt in [$repo] ----" cp $SFIGNOREPATH/seafile-ignore.txt $repo/ echo "" fi done cd -