Mercurial > ec-dotfiles
comparison moefetch.sh @ 234:58ad057cd2ec
- Fix for openssl output parser for generating hashed password
- Ensuring usage of POSIX-only subsets of GNU tools capability
| author | Edho P. Arief <me@myconan.net> |
|---|---|
| date | Thu, 08 Apr 2010 16:30:29 +0700 |
| parents | 5438d80244a3 |
| children | 649b7d4b056a |
comparison
equal
deleted
inserted
replaced
| 233:38d6c17353fb | 234:58ad057cd2ec |
|---|---|
| 342 do | 342 do |
| 343 case "$opt" in | 343 case "$opt" in |
| 344 s) SITE="$OPTARG";; | 344 s) SITE="$OPTARG";; |
| 345 n) NOCLEAN=1;; | 345 n) NOCLEAN=1;; |
| 346 p) | 346 p) |
| 347 LOGIN_PASS=$(printf "%s" "$OPTARG" | openssl dgst -sha1) | 347 LOGIN_PASS=$(printf "%s" "$OPTARG" | openssl dgst -sha1 | sed -e 's/.*\([[:xdigit:]]\{40\}\).*/\1/') |
| 348 has_pass=1 | 348 has_pass=1 |
| 349 ;; | 349 ;; |
| 350 u) | 350 u) |
| 351 LOGIN_USER="$OPTARG" | 351 LOGIN_USER="$OPTARG" |
| 352 has_user=1 | 352 has_user=1 |
| 380 _use_login=0 # variable to check whether a login is used or not | 380 _use_login=0 # variable to check whether a login is used or not |
| 381 } | 381 } |
| 382 | 382 |
| 383 main() | 383 main() |
| 384 { | 384 { |
| 385 # removing GNU-ism as much as possible | |
| 386 POSIXLY_CORRECT=1 | |
| 385 #initialize global variables | 387 #initialize global variables |
| 386 init_globals | 388 init_globals |
| 387 #print welcome message | 389 #print welcome message |
| 388 msg_welcome | 390 msg_welcome |
| 389 # initialization | 391 # initialization |
