diff 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
line wrap: on
line diff
--- a/moefetch.sh	Mon Apr 05 20:01:39 2010 +0000
+++ b/moefetch.sh	Thu Apr 08 16:30:29 2010 +0700
@@ -344,7 +344,7 @@
 			s) SITE="$OPTARG";;
 			n) NOCLEAN=1;;
 			p)
-				LOGIN_PASS=$(printf "%s" "$OPTARG" | openssl dgst -sha1)
+				LOGIN_PASS=$(printf "%s" "$OPTARG" | openssl dgst -sha1 | sed -e 's/.*\([[:xdigit:]]\{40\}\).*/\1/')
 				has_pass=1
 			;;
 			u)
@@ -382,6 +382,8 @@
 
 main()
 {
+	# removing GNU-ism as much as possible
+	POSIXLY_CORRECT=1
 	#initialize global variables
 	init_globals
 	#print welcome message