„README.md“ ändern
Fixed SmartlockAuth to add optional columns - had to be concatenated with jq -s (slurp mode)
This commit is contained in:
parent
43345f3947
commit
243e9646d3
@ -16,7 +16,7 @@ All things were tested with ...
|
|||||||
* MariaDB 10.1.34
|
* MariaDB 10.1.34
|
||||||
* Nuki Bridge Firmware 1.11.4 (checked @ 30.11.2018)
|
* Nuki Bridge Firmware 1.11.4 (checked @ 30.11.2018)
|
||||||
* Nuki Bridge WiFi Firmware 1.2.0 (checked @ 30.11.2018)
|
* Nuki Bridge WiFi Firmware 1.2.0 (checked @ 30.11.2018)
|
||||||
* Nuki Smartlock Firmware 67330 (checked @ 30.11.2018)
|
* Nuki Smartlock Firmware 67331 (checked @ 10.12.2018)
|
||||||
* Nuki Swagger API → https://api.nuki.io (here you can find documentation on data models)
|
* Nuki Swagger API → https://api.nuki.io (here you can find documentation on data models)
|
||||||
* Nuki Web → https://web.nuki.io (here you can retrieve your personal API key)
|
* Nuki Web → https://web.nuki.io (here you can retrieve your personal API key)
|
||||||
|
|
||||||
@ -279,7 +279,7 @@ while [ true ]; do
|
|||||||
mysql -u$DB_USER -p$DB_PASS $DB_NAME -e"TRUNCATE TABLE SmartlockLog; LOAD DATA LOCAL INFILE '"$FILE_BASE"_SmartlockLog.csv' INTO TABLE SmartlockLog FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n' IGNORE 1 LINES;"
|
mysql -u$DB_USER -p$DB_PASS $DB_NAME -e"TRUNCATE TABLE SmartlockLog; LOAD DATA LOCAL INFILE '"$FILE_BASE"_SmartlockLog.csv' INTO TABLE SmartlockLog FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n' IGNORE 1 LINES;"
|
||||||
|
|
||||||
eval "curl -X GET $CURL_HEADER $BASE_URL/smartlock/auth -o "$FILE_BASE"_SmartlockAuth.json"
|
eval "curl -X GET $CURL_HEADER $BASE_URL/smartlock/auth -o "$FILE_BASE"_SmartlockAuth.json"
|
||||||
jq -r "$JQ_CSV" "$FILE_BASE"_SmartlockAuth.json > "$FILE_BASE"_SmartlockAuth.csv
|
jq -r ".[]|{authId}+{allowedFromDate}+{allowedUntilDate}+{allowedFromTime}+{allowedUntilTime}+{allowedWeekDays}+{lastActiveDate}+{creationDate}+{updateDate}+." "$FILE_BASE"_SmartlockAuth.json | jq -s . | jq -r "$JQ_CSV" > "$FILE_BASE"_SmartlockAuth.csv
|
||||||
sed -i 's/true/1/g' "$FILE_BASE"_SmartlockAuth.csv
|
sed -i 's/true/1/g' "$FILE_BASE"_SmartlockAuth.csv
|
||||||
sed -i 's/false/0/g' "$FILE_BASE"_SmartlockAuth.csv
|
sed -i 's/false/0/g' "$FILE_BASE"_SmartlockAuth.csv
|
||||||
mysql -u$DB_USER -p$DB_PASS $DB_NAME -e"TRUNCATE TABLE SmartlockAuth; LOAD DATA LOCAL INFILE '"$FILE_BASE"_SmartlockAuth.csv' INTO TABLE SmartlockAuth FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n' IGNORE 1 LINES;"
|
mysql -u$DB_USER -p$DB_PASS $DB_NAME -e"TRUNCATE TABLE SmartlockAuth; LOAD DATA LOCAL INFILE '"$FILE_BASE"_SmartlockAuth.csv' INTO TABLE SmartlockAuth FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n' IGNORE 1 LINES;"
|
||||||
|
Loading…
Reference in New Issue
Block a user