#!/bin/bash ## ## makekey - Generate licence keys ## ## Copyright 1997 SpellCaster Telecommunications ## ## $Id: makekey,v 1.1 2004/03/11 03:59:31 bcrl Exp $ ## ## # makekey if [ $# -ne 2 ] ; then echo 1>&2 "Usage:" echo 1>&2 " $0 " exit 1 fi lisc="`printf %d "$1"`" ser="`date +%Y%m%d%H%M``printf %08x "$2"`" echo 1>&2 "Creating a key with $lisc liscenses, serial number: $ser" key="`printf %02x $lisc`$ser" key="${key}00`dd 2>/dev/null if=/dev/urandom bs=1 count=4 | hexdump -e "1/1 \\\"%02x\\\""`" printf >/tmp/makekey.$$ "`echo "$key" | sed -e 's/[0-9a-fA-F]\{2\}/\\\\x&/g'`" printf >>/tmp/makekey.$$ "\x16\xb6\x80\xcb\x1e\xcc\x01\xbe\x32\x1a\x8c\x9d\xaf\x92\x22\x0d\x74\xd0\xeb\x60\x29\xbb\x0f\x05\x07\x39\x61\xb1\xd1\x4f\xbe\x79" echo "$key`md5sum /tmp/makekey.$$ | cut -f1 -d\ `" rm -f /tmp/makekey.$$ exit 0