comparison bin/moeauto-genlink @ 138:f963d52c031a

Merge.
author Edho Arief <edho@myconan.net>
date Wed, 02 Nov 2011 22:12:16 +0700
parents 5bafb912837e
children
comparison
equal deleted inserted replaced
137:983beb13c736 138:f963d52c031a
1 #!/bin/sh
2
3 if [ "$#" -lt 1 ]; then
4 cat <<EOF
5 Usage: $(basename -- "$0")
6 EOF
7 exit 1
8 fi
9
10 if [ ! -r "$*" ] || [ -d "$*" ]; then
11 cat <<EOF
12 File "$*" can't be read!
13 EOF
14 exit 1
15 fi
16
17 SERVER=
18 while read LINE; do
19 if [ -n "$(printf "%s" "${LINE}" | grep "^SERVER=")" ]; then
20 SERVER=$(printf "%s" "${LINE}" | sed -e 's/SERVER=//')
21 else
22 [ -n "${SERVER}" ] && [ ! -z "$(printf "%s" "${LINE}" | grep -v "^$")" ] && moefetch check -s "${SERVER}" ${LINE}
23 fi
24 done < "$*"