Mercurial > ec-dotfiles
annotate bin/moeauto @ 432:087278fd11d8
Don't fold by default.
author | Edho Arief <edho@myconan.net> |
---|---|
date | Sat, 29 Dec 2012 22:08:33 +0700 |
parents | 5bafb912837e |
children |
rev | line source |
---|---|
124
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
1 #!/bin/sh |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
2 |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
3 if [ "$#" -lt 1 ]; then |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
4 cat <<EOF |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
5 Usage: $(basename -- "$0") |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
6 EOF |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
7 exit 1 |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
8 fi |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
9 |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
10 if [ ! -r "$*" ] || [ -d "$*" ]; then |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
11 cat <<EOF |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
12 File "$*" can't be read! |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
13 EOF |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
14 exit 1 |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
15 fi |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
16 |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
17 SERVER= |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
18 while read LINE; do |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
19 if [ -n "$(printf "%s" "${LINE}" | grep "^SERVER=")" ]; then |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
20 SERVER=$(printf "%s" "${LINE}" | sed -e 's/SERVER=//') |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
21 else |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
22 [ -n "${SERVER}" ] && [ ! -z "$(printf "%s" "${LINE}" | grep -v "^$")" ] && moefetch fetch -s "${SERVER}" ${LINE} |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
23 fi |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
24 done < "$*" |