Герхард PICCORO Lenz McKAY
cfb83aab12
* using https://codeberg.org/minenux/minetest-mod-formspecs * using https://codeberg.org/minenux/minetest-mod-auth_rx * changes: ** provide a way to initialize files if there is not one currently doe snot touch the auth.txt file neither converted ** solves: close: https://codeberg.org/minenux/minetest-mod-auth_rx/issues/6 ** solved: close: https://bitbucket.org/sorcerykid/auth_rx/issues/7 ** init the files when are fresh install, still do not convert from auth.txt ** player object check for problematic joins on inpcomplete auth process ** close fixed https://codeberg.org/minenux/minetest-mod-auth_rx/issues/2 ** added missing depends formspecs (it work without in basics but, some commands needs) ** we will later aded formspecs checks to made optional
39 lines
858 B
Awk
39 lines
858 B
Awk
#!/bin/awk -f
|
|
|
|
################################################################################
|
|
# Database Export Script for Auth Redux Mod
|
|
# ------------------------------------------
|
|
# This script will revert to the default 'auth.txt' flat-file database required
|
|
# by the builtin authentication handler.
|
|
#
|
|
# EXAMPLE:
|
|
# awk -f revert.awk ~/.minetest/worlds/world/auth.db
|
|
################################################################################
|
|
|
|
BEGIN {
|
|
FS = ":";
|
|
OFS = ":";
|
|
db_file = "auth.txt";
|
|
|
|
path = ARGV[ 1 ]
|
|
if( sub( /[-_A-Za-z0-9]+\.db$/, "", path ) == 0 ) {
|
|
# sanity check for nonstandard input file
|
|
path = "";
|
|
}
|
|
|
|
print "Reverting " ARGV[ 1 ] "...";
|
|
}
|
|
|
|
NF == 10 {
|
|
username = $1;
|
|
password = $2;
|
|
assigned_privs = $10;
|
|
newlogin = $4;
|
|
|
|
print username, password, assigned_privs, newlogin > path db_file;
|
|
}
|
|
|
|
END {
|
|
print "Done!"
|
|
}
|