Mercurial > ec-dotfiles
comparison bin/moeauto @ 129:f18a27a0e8fc
Merge branch.
author | Edho Arief <edho@myconan.net> |
---|---|
date | Sat, 29 Oct 2011 11:40:35 +0700 |
parents | 5bafb912837e |
children |
comparison
equal
deleted
inserted
replaced
121:0c3b473b9af7 | 129:f18a27a0e8fc |
---|---|
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 fetch -s "${SERVER}" ${LINE} | |
23 fi | |
24 done < "$*" |