2007-12-27 20:54:05 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2007-12-28 13:41:46 +01:00
|
|
|
# This script converts the flat-text password file
|
2007-12-27 20:54:05 +01:00
|
|
|
# to the new sqlite3 database.
|
|
|
|
#
|
|
|
|
|
|
|
|
DBFILE="dgamelaunch.db"
|
|
|
|
|
2007-12-28 13:41:46 +01:00
|
|
|
if [-e "$DBFILE"]; then
|
|
|
|
echo "$DBFILE already exists.";
|
|
|
|
exit;
|
|
|
|
fi
|
2007-12-27 20:54:05 +01:00
|
|
|
|
2007-12-28 13:41:46 +01:00
|
|
|
sqlite3 "$DBFILE" "create table dglusers (id integer primary key, username text, email text, env text, password text, flags integer);"
|
2007-12-27 20:54:05 +01:00
|
|
|
|
2007-12-28 13:41:46 +01:00
|
|
|
cat dgl-login | sed -e "s/'/''/g" -e "s/^\([^:]*\):\([^:]*\):\([^:]*\):/insert into dglusers (username, email, password, env, flags) values ('\1', '\2', '\3', '', 0); /g" > dgl-login.tmp
|
2007-12-27 20:54:05 +01:00
|
|
|
|
2007-12-28 13:41:46 +01:00
|
|
|
sqlite3 "$DBFILE" ".read dgl-login.tmp"
|