2017-07-29 21:12:08 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-01-24 15:43:12 +00:00
|
|
|
CLONE_CONF=`dirname $(realpath $0)`;
|
|
|
|
CLONE_CONF=`dirname $CLONE_CONF`;
|
|
|
|
CLONE_CONF="$CLONE_CONF/clone/clone.conf";
|
|
|
|
|
2017-07-29 21:12:08 +00:00
|
|
|
echo "1. Checking argument 'ssid'"
|
|
|
|
[ $# -lt 1 ] && echo " > failure" && exit;
|
|
|
|
echo " > done";
|
|
|
|
|
|
|
|
|
|
|
|
echo "2. Fetching SALT and PEPPER from conf";
|
2018-01-24 15:43:12 +00:00
|
|
|
source $CLONE_CONF && echo " > done" || echo " > error" || exit 1;
|
2017-07-29 21:12:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
echo "3. Processing key";
|
|
|
|
PASS=`echo -ne "$WIFI_PEPPER$(echo -ne "${WIFI_SALT}${1}" | sha512sum | sed 's/[ \t]*-$//')" | sha512sum | sed 's/[ \t]*-//' | cut -b 1-63`;
|
|
|
|
echo " > done";
|
|
|
|
|
|
|
|
echo -e "\n\nKEY is '$PASS'";
|