Skip to content

Instantly share code, notes, and snippets.

View rdooley's full-sized avatar
🗿

Rees Dooley rdooley

🗿
  • Shopify
  • Portland, OR
View GitHub Profile
#!/bin/bash
# https://httpd.apache.org/docs/2.2/misc/password_encryptions.html
HTPASSWD=$1
USERNAME=$2
PASSWORD=$3
ENTRY=`cat $HTPASSWD | grep "^$USERNAME:"`
HASH=`echo $ENTRY | cut -f 2 -d :`
SALT=`echo $HASH | cut -f 3 -d $`