frigoclavis/scripts/get_token_co_hash

19 lines
232 B
Bash
Executable file

#!/bin/bash
if [[ -z $1 ]] ; then
echo "usage: $0 <token_file>"
exit 1
fi
FILE=$1
if [[ ! -f $FILE ]] ; then
echo "File $FILE does not exist"
exit 2
fi
cut -d '#' -f 1 $FILE \
| base64 -d \
| sha1sum \
| sed 's/\s.*$//'