2 if [ -z "$1" -o ! -f "$1" ]; then
3 printf "Usage: %s dbfile\n" `basename "$0"`
5 elif [ ! -w "$1" ]; then
6 printf "Error: You need write permissions for %s\n" "$1" 1>&2
11 for util
in md5sum sqlite
; do
12 if [ ! -x "`which $util 2>/dev/null`" ]; then
13 echo "We need the $util utility"
18 echo "Add a user to the admin table"
25 md5pass
=`printf "$pass"|md5sum|cut -c 1-32`
26 sql
=`printf "INSERT INTO admins (name, pass) VALUES ('%s', '%s')" "$user" "$md5pass"`
27 sqlite
"$dbfile" "$sql"