| version 1.19, 2002/06/24 11:03:40 |
version 1.20, 2002/06/24 15:55:29 |
|
|
| # username, usernam userna, .. user supported |
# username, usernam userna, .. user supported |
| # password, ... supported |
# password, ... supported |
| # Hi rajo, fix your things before commiting in :-/ : |
# Hi rajo, fix your things before commiting in :-/ : |
| #if [ -f "$CONFIG_FILE" ]; then |
if [ -f "$CONFIG_FILE" ]; then |
| # NAME=`awk '/^#/ { next; } \ |
NAME=`awk 'BEGIN { FS="[ =]+" } /^#/ { next; } \ |
| # /^user/ { if (NF > 2) { print $3; } \ |
/^user/ { if (NF > 2) { print $3; exit; } \ |
| # else { print $2; } exit; }' "$CONFIG_FILE"`; |
else { print $2; } exit; }' "$CONFIG_FILE"`; |
| # PASS=`awk '/^#/ { next; } \ |
PASS=`awk 'BEGIN { FS="[ =]+" } /^#/ { next; } \ |
| # /^pass/ { if (NF > 2) { print $3; } \ |
/^pass/ { if (NF > 2) { print $3; exit; } \ |
| # else { print $2; } exit; }' "$CONFIG_FILE"`; |
else { print $2; } exit; }' "$CONFIG_FILE"`; |
| #fi |
fi |
| |
|
| echo -n "Looking for alias file '$CONFIG_FILE'... "; |
echo -n "Looking for alias file '$CONFIG_FILE'... "; |
| if [ -f "$CONFIG_FILE" ]; then |
if [ -f "$CONFIG_FILE" ]; then |
| echo "found."; |
echo "found."; |
| echo -n "Looking for username... "; |
echo -n "Looking for username... "; |
| NAME=`grep -v '^#' "$CONFIG_FILE" \ |
NAME=`awk 'BEGIN { FS="[ =]+" } /^#/ { next; } \ |
| | grep -E '^user[a-z]*[ ]*=[ ]*' \ |
/^user/ { if (NF > 2) { print $3; exit; } \ |
| | sed 's/^user[a-z]*[ ]*=[ ]*\(.*\)[ ]*$/\1/' \ |
else { print $2; } exit; }' "$CONFIG_FILE"`; |
| | head -n 1`; |
|
| if [ -z "$NAME" ]; then |
if [ -z "$NAME" ]; then |
| echo "not found."; |
echo "not found."; |
| else |
else |
| Line 83 if [ -f "$CONFIG_FILE" ]; then |
|
| Line 83 if [ -f "$CONFIG_FILE" ]; then |
|
| fi |
fi |
| |
|
| echo -n "Looking for password... "; |
echo -n "Looking for password... "; |
| PASS=`grep -v '^#' "$CONFIG_FILE" \ |
PASS=`awk 'BEGIN { FS="[ =]+" } /^#/ { next; } \ |
| | grep -E '^pass[a-z]*[ ]*=[ ]*' \ |
/^pass/ { if (NF > 2) { print $3; exit; } \ |
| | sed 's/^pass[a-z]*[ ]*=[ ]*\(.*\)[ ]*$/\1/' \ |
else { print $2; } exit; }' "$CONFIG_FILE"`; |
| | head -n 1`; |
|
| if [ -z "$PASS" ]; then |
if [ -z "$PASS" ]; then |
| echo "not found."; |
echo "not found."; |
| else |
else |