* When saving a Task, if the status is COMPLETED then also set PERCENT-COMPLETE:100...
[citadel.git] / citadel / migrate_aliases.sh
blobbc5c31ef3caf89b21e810fdb6638c6bfcf82c2cd
1 #!/bin/bash
2 if test -z "$1"; then
3 echo "Usage: $0 mail.aliases"
4 exit
5 fi
7 CITALIAS=$1
8 if test -f /etc/aliases; then
9 # don't work with temp fils, so they can't get hijacked.
10 # sorry users with megabytes of aliases.
11 NLINES=`cat /etc/aliases | \
12 sed -e "s; *;;g" \
13 -e "s;\t*;;g" | \
14 grep -v ^root: | \
15 grep -v ^# | \
16 sed -e "s;:root;,room_aide;" \
17 -e "s;:;,;" |wc -l`
19 for ((i=1; i <= $NLINES; i++)); do
20 ALIAS=` cat /etc/aliases | \
21 sed -e "s; *;;g" \
22 -e "s;\t*;;g" | \
23 grep -v ^root: | \
24 grep -v ^# | \
25 sed -e "s;:root;,room_aide;" \
26 -e "s;:;,;" |head -n $i |tail -n 1`
27 ORG=`echo $ALIAS|sed "s;,.*;;"`
28 if grep "$ORG" "$CITALIAS"; then
29 echo "Ignoring Alias $ORG as its already there"
30 else
31 echo "$ALIAS" >>$CITALIAS
33 done
34 else
35 echo "no /etc/aliases found."
36 fi