#/bin/sh
PASSWD_FILE="$1"
export SALT=$(cat /dev/urandom | tr -cd 'a-f0-9' | head -c 32)
if [ -f /opt/extparam/fddp ]; then
	export PASSWD=$(cat /opt/extparam/fddp)
else
	export PASSWD=$(cat /opt/extparam/mac_address_0)
fi
export PASSWD=$(echo -n $PASSWD | tr -d '\n' | sha256sum | awk '{print $1}')
export PASSWD=$(echo -n $PASSWD+$SALT | tr -d '\n' | sha256sum | awk '{print $1}')
echo admin:1:$SALT:$PASSWD:adminaccount > $PASSWD_FILE
echo IseServiceUser:1:$SALT:$PASSWD:serviceaccount >> $PASSWD_FILE
echo "" >> $PASSWD_FILE