-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathadd_mirror.sh
More file actions
executable file
·25 lines (23 loc) · 744 Bytes
/
add_mirror.sh
File metadata and controls
executable file
·25 lines (23 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
TYPE=$1
NAME=$2
LINK=$3
LANG=$4
TAG=$5
git pull
count=`grep "$LINK" mirror-original.csv | wc -l`
if [[ $TYPE -eq 1 && $count -eq 0 ]]
then
echo "$NAME, https://mirror.xyz/$LINK, https://submirror.xyz/$LINK, $TAG" >> mirror-original.csv
echo "$NAME, https://mirror.xyz/$LINK, https://submirror.xyz/$LINK, $LANG, $TAG" >> mirror-original-langs.csv
elif [[ $TYPE -eq 2 && $count -eq 0 ]]
then
echo "$NAME, https://$LINK.mirror.xyz/, https://$LINK.submirror.xyz/, $TAG" >> mirror-original.csv
echo "$NAME, https://$LINK.mirror.xyz/, https://$LINK.submirror.xyz/, $LANG, $TAG" >> mirror-original-langs.csv
elif [[ $count -eq 1 ]]
then
echo "$LINK is exists."
else
echo "Nothing."
fi
bash git_push.sh "Add $NAME"