comparison bin/moeauto-genlink @ 124:5bafb912837e

Massive addition of old scripts collection.
author Edho Prima Arief <edho@myconan.net>
date Wed, 26 Oct 2011 15:22:00 +0700
parents
children
comparison
equal deleted inserted replaced
123:173833e4ba35 124:5bafb912837e
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 < "$*"