]> skyeroc.xyz Git - dgamelaunch/commitdiff
Add a shell script to convert the old flat-text database to sqlite database.
authorPasi Kallinen <paxed@alt.org>
Thu, 27 Dec 2007 19:54:05 +0000 (19:54 +0000)
committerPasi Kallinen <paxed@alt.org>
Thu, 27 Dec 2007 19:54:05 +0000 (19:54 +0000)
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@374 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

convert_dgl-login.sh [new file with mode: 0644]

diff --git a/convert_dgl-login.sh b/convert_dgl-login.sh
new file mode 100644 (file)
index 0000000..e4b44df
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+# This script converts the flat-text file password file
+# to the new sqlite3 database.
+#
+
+DBFILE="dgamelaunch.db"
+
+sqlite3 $DBFILE "create table dglusers (id integer primary key, username text, email text, env text, password text, flags integer);"
+
+for x in `cat dgl-login`; do
+    username="`echo $x | cut -d':' -f1`";
+    email="`echo $x | cut -d':' -f2`";
+    password="`echo $x | cut -d':' -f3`";
+    env="`echo $x | cut -d':' -f4`";
+    flags="0";
+
+    cmdstring="insert into dglusers (username, email, env, password, flags) values ('"$username"', '"$email"', '"$env"', '"$password"', "$flags")"
+    sqlite3 $DBFILE "$cmdstring"
+done;
+