summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2018-08-24 12:58:52 +0200
committeremkael <emkael@tlen.pl>2018-08-24 12:58:52 +0200
commitcc3acaec7272b57cfd89472690795601ddf7acec (patch)
treea194b9efe17db6a878caceea1355c2bf4298614d /bin
parent6f9756cf49e2e2802916ef251732a9377ddd756b (diff)
Addingg import script for hidden PIDs
Diffstat (limited to 'bin')
-rwxr-xr-xbin/hidden-import.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/hidden-import.sh b/bin/hidden-import.sh
new file mode 100755
index 0000000..ecd9f27
--- /dev/null
+++ b/bin/hidden-import.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+DBCONFIG=($(jq -r '.[]' config/import-db.json))
+mysql -h ${DBCONFIG[2]} -P ${DBCONFIG[3]} -u ${DBCONFIG[0]} --password=${DBCONFIG[1]} -e "SET foreign_key_checks = 0;
+DELETE FROM hidden_players;
+LOAD DATA LOCAL INFILE '$1'
+INTO TABLE hidden_players
+FIELDS TERMINATED BY ';' ENCLOSED BY '\"';
+SET foreign_key_checks = 1
+" ${DBCONFIG[4]}