„README.md“ ändern
This commit is contained in:
parent
15f8b7f1bd
commit
a3110dc2f2
185
README.md
185
README.md
@ -61,47 +61,47 @@ apt-get install mariadb-server
|
|||||||
CREATE TABLE IF NOT EXISTS Smartlock
|
CREATE TABLE IF NOT EXISTS Smartlock
|
||||||
(
|
(
|
||||||
`accountId` VARCHAR(9) NOT NULL,
|
`accountId` VARCHAR(9) NOT NULL,
|
||||||
`adminPinState` TINYINT NOT NULL,
|
`adminPinState` SMALLINT NOT NULL,
|
||||||
`advertisingMode` TINYINT NOT NULL,
|
`advertisingMode` SMALLINT NOT NULL,
|
||||||
`authId` VARCHAR(24),
|
`authId` VARCHAR(24),
|
||||||
`autoLockTimeout` SMALLINT NOT NULL,
|
`autoLockTimeout` SMALLINT NOT NULL,
|
||||||
`autoUnlatch` BOOLEAN NOT NULL,
|
`autoUnlatch` BOOLEAN NOT NULL,
|
||||||
`automaticBatteryTypeDetection` BOOLEAN NOT NULL,
|
`automaticBatteryTypeDetection` BOOLEAN NOT NULL,
|
||||||
`batteryCritical` BOOLEAN NOT NULL,
|
`batteryCritical` BOOLEAN NOT NULL,
|
||||||
`batteryType` TINYINT NOT NULL,
|
`batteryType` SMALLINT NOT NULL,
|
||||||
`buttonEnabled` BOOLEAN NOT NULL,
|
`buttonEnabled` BOOLEAN NOT NULL,
|
||||||
`creationDate` DATETIME NOT NULL,
|
`creationDate` DATETIME NOT NULL,
|
||||||
`daylightSavingMode` TINYINT NOT NULL,
|
`daylightSavingMode` SMALLINT NOT NULL,
|
||||||
`detachedCylinder` BOOLEAN NOT NULL,
|
`detachedCylinder` BOOLEAN NOT NULL,
|
||||||
`doubleButtonPressAction` TINYINT NOT NULL,
|
`doubleButtonPressAction` SMALLINT NOT NULL,
|
||||||
`favorite` BOOLEAN NOT NULL,
|
`favorite` BOOLEAN NOT NULL,
|
||||||
`firmwareVersion` VARCHAR(255),
|
`firmwareVersion` VARCHAR(255),
|
||||||
`fobAction1` TINYINT NOT NULL,
|
`fobAction1` SMALLINT NOT NULL,
|
||||||
`fobAction2` TINYINT NOT NULL,
|
`fobAction2` SMALLINT NOT NULL,
|
||||||
`fobAction3` TINYINT NOT NULL,
|
`fobAction3` SMALLINT NOT NULL,
|
||||||
`fobPaired` BOOLEAN NOT NULL,
|
`fobPaired` BOOLEAN NOT NULL,
|
||||||
`keypadPaired` BOOLEAN NOT NULL,
|
`keypadPaired` BOOLEAN NOT NULL,
|
||||||
`lastAction` TINYINT NOT NULL,
|
`lastAction` SMALLINT NOT NULL,
|
||||||
`latitude` FLOAT NOT NULL,
|
`latitude` FLOAT NOT NULL,
|
||||||
`ledBrightness` TINYINT NOT NULL,
|
`ledBrightness` SMALLINT NOT NULL,
|
||||||
`ledEnabled` BOOLEAN NOT NULL,
|
`ledEnabled` BOOLEAN NOT NULL,
|
||||||
`lngTimeout` SMALLINT NOT NULL,
|
`lngTimeout` SMALLINT NOT NULL,
|
||||||
`lockedPositionOffsetDegrees` SMALLINT NOT NULL,
|
`lockedPositionOffsetDegrees` SMALLINT NOT NULL,
|
||||||
`longitude` FLOAT NOT NULL,
|
`longitude` FLOAT NOT NULL,
|
||||||
`mainName` VARCHAR(255),
|
`mainName` VARCHAR(255),
|
||||||
`mode` TINYINT NOT NULL,
|
`mode` SMALLINT NOT NULL,
|
||||||
`name` VARCHAR(255),
|
`name` VARCHAR(255),
|
||||||
`pairingEnabled` BOOLEAN NOT NULL,
|
`pairingEnabled` BOOLEAN NOT NULL,
|
||||||
`serverState` TINYINT NOT NULL,
|
`serverState` SMALLINT NOT NULL,
|
||||||
`singleButtonPressAction` TINYINT NOT NULL,
|
`singleButtonPressAction` SMALLINT NOT NULL,
|
||||||
`singleLock` BOOLEAN NOT NULL,
|
`singleLock` BOOLEAN NOT NULL,
|
||||||
`singleLockedPositionOffsetDegrees` SMALLINT NOT NULL,
|
`singleLockedPositionOffsetDegrees` SMALLINT NOT NULL,
|
||||||
`smartlockId` VARCHAR(9) NOT NULL PRIMARY KEY, /*primary key = unique!*/
|
`smartlockId` VARCHAR(9) NOT NULL PRIMARY KEY, /*primary key = unique!*/
|
||||||
`state` TINYINT NOT NULL,
|
`state` SMALLINT NOT NULL,
|
||||||
`timezoneOffset` SMALLINT NOT NULL,
|
`timezoneOffset` SMALLINT NOT NULL,
|
||||||
`totalDegrees` SMALLINT NOT NULL,
|
`totalDegrees` SMALLINT NOT NULL,
|
||||||
`trigger` TINYINT NOT NULL,
|
`trigger` SMALLINT NOT NULL,
|
||||||
`type` TINYINT NOT NULL,
|
`type` SMALLINT NOT NULL,
|
||||||
`unlatchDuration` SMALLINT NOT NULL,
|
`unlatchDuration` SMALLINT NOT NULL,
|
||||||
`unlockedPositionOffsetDegrees` SMALLINT NOT NULL,
|
`unlockedPositionOffsetDegrees` SMALLINT NOT NULL,
|
||||||
`unlockedToLockedTransitionOffsetDegrees` SMALLINT NOT NULL,
|
`unlockedToLockedTransitionOffsetDegrees` SMALLINT NOT NULL,
|
||||||
@ -111,15 +111,15 @@ CREATE TABLE IF NOT EXISTS Smartlock
|
|||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS SmartlockLog
|
CREATE TABLE IF NOT EXISTS SmartlockLog
|
||||||
(
|
(
|
||||||
`action` TINYINT NOT NULL,
|
`action` SMALLINT NOT NULL,
|
||||||
`authId` VARCHAR(24),
|
`authId` VARCHAR(24),
|
||||||
`autoUnlock` BOOLEAN NOT NULL,
|
`autoUnlock` BOOLEAN NOT NULL,
|
||||||
`date` DATETIME NOT NULL,
|
`date` DATETIME NOT NULL,
|
||||||
`id` VARCHAR(24) NOT NULL PRIMARY KEY, /*primary key = unique!*/
|
`id` VARCHAR(24) NOT NULL PRIMARY KEY, /*primary key = unique!*/
|
||||||
`name` VARCHAR(255),
|
`name` VARCHAR(255),
|
||||||
`smartlockId` VARCHAR(9) NOT NULL,
|
`smartlockId` VARCHAR(9) NOT NULL,
|
||||||
`state` TINYINT NOT NULL,
|
`state` SMALLINT NOT NULL,
|
||||||
`trigger` TINYINT NOT NULL
|
`trigger` SMALLINT NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ CREATE TABLE IF NOT EXISTS SmartlockAuth
|
|||||||
`name` VARCHAR(255),
|
`name` VARCHAR(255),
|
||||||
`remoteAllowed` BOOLEAN NOT NULL,
|
`remoteAllowed` BOOLEAN NOT NULL,
|
||||||
`smartlockId` VARCHAR(9) NOT NULL,
|
`smartlockId` VARCHAR(9) NOT NULL,
|
||||||
`type` TINYINT NOT NULL,
|
`type` SMALLINT NOT NULL,
|
||||||
`updateDate` DATETIME NOT NULL
|
`updateDate` DATETIME NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ CREATE TABLE IF NOT EXISTS SmartlockAuth
|
|||||||
/*look script: you need to insert the nukiId in jq*/
|
/*look script: you need to insert the nukiId in jq*/
|
||||||
CREATE TABLE IF NOT EXISTS BridgeCallbackList
|
CREATE TABLE IF NOT EXISTS BridgeCallbackList
|
||||||
(
|
(
|
||||||
`id` TINYINT NOT NULL,
|
`id` SMALLINT NOT NULL,
|
||||||
`nukiId` VARCHAR(9) NOT NULL,
|
`nukiId` VARCHAR(9) NOT NULL,
|
||||||
`url` TEXT NOT NULL
|
`url` TEXT NOT NULL
|
||||||
);
|
);
|
||||||
@ -151,15 +151,15 @@ CREATE TABLE IF NOT EXISTS BridgeCallbackList
|
|||||||
CREATE TABLE IF NOT EXISTS BridgeInfo
|
CREATE TABLE IF NOT EXISTS BridgeInfo
|
||||||
(
|
(
|
||||||
`appVersion` VARCHAR(24),
|
`appVersion` VARCHAR(24),
|
||||||
`bridgeType` TINYINT NOT NULL,
|
`bridgeType` SMALLINT NOT NULL,
|
||||||
`currentTime` DATETIME NOT NULL,
|
`currentTime` DATETIME NOT NULL,
|
||||||
`firmwareVersion` VARCHAR(24),
|
`firmwareVersion` VARCHAR(24),
|
||||||
`hardwareId` VARCHAR(24),
|
`hardwareId` VARCHAR(24),
|
||||||
`name` VARCHAR(255) NOT NULL,
|
`name` VARCHAR(255) NOT NULL,
|
||||||
`nukiId` VARCHAR(9) NOT NULL PRIMARY KEY, /*primary key = unique!*/
|
`nukiId` VARCHAR(9) NOT NULL PRIMARY KEY, /*primary key = unique!*/
|
||||||
`paired` TINYINT NOT NULL,
|
`paired` SMALLINT NOT NULL,
|
||||||
`rssi` TINYINT NOT NULL,
|
`rssi` SMALLINT NOT NULL,
|
||||||
`serverConnected` TINYINT NOT NULL,
|
`serverConnected` SMALLINT NOT NULL,
|
||||||
`serverId` VARCHAR(24) NOT NULL,
|
`serverId` VARCHAR(24) NOT NULL,
|
||||||
`uptime` BIGINT NOT NULL,
|
`uptime` BIGINT NOT NULL,
|
||||||
`wifiFirmwareVersion` VARCHAR(24)
|
`wifiFirmwareVersion` VARCHAR(24)
|
||||||
@ -169,9 +169,9 @@ CREATE TABLE IF NOT EXISTS BridgeInfo
|
|||||||
CREATE TABLE IF NOT EXISTS BridgeList
|
CREATE TABLE IF NOT EXISTS BridgeList
|
||||||
(
|
(
|
||||||
`batteryCritical` BOOLEAN NOT NULL,
|
`batteryCritical` BOOLEAN NOT NULL,
|
||||||
`name` TINYINT NOT NULL,
|
`name` SMALLINT NOT NULL,
|
||||||
`nukiId` VARCHAR(9) NOT NULL PRIMARY KEY, /*primary key = unique!*/
|
`nukiId` VARCHAR(9) NOT NULL PRIMARY KEY, /*primary key = unique!*/
|
||||||
`state` TINYINT NOT NULL,
|
`state` SMALLINT NOT NULL,
|
||||||
`stateName` VARCHAR(24) NOT NULL,
|
`stateName` VARCHAR(24) NOT NULL,
|
||||||
`timestamp` DATETIME NOT NULL
|
`timestamp` DATETIME NOT NULL
|
||||||
);
|
);
|
||||||
@ -182,7 +182,7 @@ CREATE TABLE IF NOT EXISTS BridgeLockState
|
|||||||
(
|
(
|
||||||
`batteryCritical` BOOLEAN NOT NULL,
|
`batteryCritical` BOOLEAN NOT NULL,
|
||||||
`nukiId` VARCHAR(9) NOT NULL PRIMARY KEY, /*primary key = unique!*/
|
`nukiId` VARCHAR(9) NOT NULL PRIMARY KEY, /*primary key = unique!*/
|
||||||
`state` TINYINT NOT NULL,
|
`state` SMALLINT NOT NULL,
|
||||||
`stateName` VARCHAR(24) NOT NULL,
|
`stateName` VARCHAR(24) NOT NULL,
|
||||||
`success` BOOLEAN NOT NULL
|
`success` BOOLEAN NOT NULL
|
||||||
);
|
);
|
||||||
@ -193,7 +193,7 @@ CREATE TABLE IF NOT EXISTS BridgeLog
|
|||||||
(
|
(
|
||||||
`bridgeId` VARCHAR(9) NOT NULL,
|
`bridgeId` VARCHAR(9) NOT NULL,
|
||||||
`cmdId` VARCHAR(9),
|
`cmdId` VARCHAR(9),
|
||||||
`connection` TINYINT,
|
`connection` SMALLINT,
|
||||||
`macAddr` VARCHAR(12),
|
`macAddr` VARCHAR(12),
|
||||||
`nukiId` VARCHAR(9),
|
`nukiId` VARCHAR(9),
|
||||||
`timestamp` DATETIME NOT NULL,
|
`timestamp` DATETIME NOT NULL,
|
||||||
@ -236,14 +236,14 @@ while [ true ]; do
|
|||||||
|
|
||||||
eval "curl -X GET $CURL_HEADER $BASE_URL/smartlock/log -o "$FILE_BASE"_SmartlockLog.json"
|
eval "curl -X GET $CURL_HEADER $BASE_URL/smartlock/log -o "$FILE_BASE"_SmartlockLog.json"
|
||||||
jq -r "$JQ_CSV" "$FILE_BASE"_SmartlockLog.json > "$FILE_BASE"_SmartlockLog.csv
|
jq -r "$JQ_CSV" "$FILE_BASE"_SmartlockLog.json > "$FILE_BASE"_SmartlockLog.csv
|
||||||
sed -i 's/,true,/,1,/g' "$FILE_BASE"_SmartlockLog.csv
|
sed -i 's/true/1/g' "$FILE_BASE"_SmartlockLog.csv
|
||||||
sed -i 's/,false,/,0,/g' "$FILE_BASE"_SmartlockLog.csv
|
sed -i 's/false/0/g' "$FILE_BASE"_SmartlockLog.csv
|
||||||
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 "$JQ_CSV" "$FILE_BASE"_SmartlockAuth.json > "$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;"
|
||||||
|
|
||||||
eval "curl -X GET $CURL_HEADER $BASE_URL/smartlock -o "$FILE_BASE"_Smartlock.json"
|
eval "curl -X GET $CURL_HEADER $BASE_URL/smartlock -o "$FILE_BASE"_Smartlock.json"
|
||||||
@ -303,26 +303,38 @@ done
|
|||||||
|
|
||||||
```
|
```
|
||||||
chmod 770 nuki_bridge_job-collector.sh
|
chmod 770 nuki_bridge_job-collector.sh
|
||||||
vim /etc/rc.local
|
|
||||||
|
vim /opt/nuki/bridge/nuki-bridge-collector.service
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
> /etc/rc.local
|
> /opt/nuki/bridge/nuki-bridge-collector.service
|
||||||
```
|
```
|
||||||
if [ -f /aafirstboot ]; then /aafirstboot start ; fi
|
|
||||||
|
[Unit]
|
||||||
if [ -f /aafirstboot ]; then /aafirstboot start ; fi
|
After=network.target
|
||||||
|
Description=Nuki Bridge Collector Service
|
||||||
nohup /opt/nuki/bridge/nuki_bridge_job-collector.sh > /opt/nuki/bridge/nuki_bridge_job-collector.log 2>&1 &
|
|
||||||
|
[Service]
|
||||||
exit 0
|
Type=simple
|
||||||
|
ExecStart=/opt/nuki/bridge/nuki_bridge_job-collector.sh
|
||||||
|
KillMode=process
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=10s
|
||||||
|
RemainAfterExit=yes
|
||||||
|
User=root
|
||||||
|
Group=root
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy= multi-user.target
|
||||||
```
|
```
|
||||||
|
|
||||||
Init the modified rc.local and check status
|
|
||||||
```
|
```
|
||||||
sudu su
|
ln -sf /opt/nuki/bridge/nuki-bridge-collector.service /etc/systemd/system/nuki-bridge-collector.service
|
||||||
. /etc/rc.local
|
systemctl daemon-reload
|
||||||
ps -afe | grep [n]uki
|
systemctl enable nuki-bridge-collector.service
|
||||||
|
|
||||||
|
service nuki-bridge-collector restart && service nuki-bridge-collector status
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 5.2.2 SSH sync user
|
#### 5.2.2 SSH sync user
|
||||||
@ -387,15 +399,15 @@ while [ true ]; do
|
|||||||
|
|
||||||
|
|
||||||
jq -r "[{bridgeType}+(.|{ids}|{hardwareId}+.[])+(.|{versions}|{appVersion}+{firmwareVersion}+{wifiFirmwareVersion}+.[])+{uptime}+{currentTime}+{serverConnected}+(.|{scanResults}|.[][])]|$JQ_CSV" "$FILE_BASE"_info.json > "$FILE_BASE"_info.csv
|
jq -r "[{bridgeType}+(.|{ids}|{hardwareId}+.[])+(.|{versions}|{appVersion}+{firmwareVersion}+{wifiFirmwareVersion}+.[])+{uptime}+{currentTime}+{serverConnected}+(.|{scanResults}|.[][])]|$JQ_CSV" "$FILE_BASE"_info.json > "$FILE_BASE"_info.csv
|
||||||
sed -i 's/,true,/,1,/g' "$FILE_BASE"_info.csv
|
sed -i 's/true/1/g' "$FILE_BASE"_info.csv
|
||||||
sed -i 's/,false,/,0,/g' "$FILE_BASE"_info.csv
|
sed -i 's/false/0/g' "$FILE_BASE"_info.csv
|
||||||
mysql -u$DB_USER -p$DB_PASS $DB_NAME -e"TRUNCATE Table BridgeInfo; LOAD DATA LOCAL INFILE '"$FILE_BASE"_info.csv' INTO TABLE BridgeInfo FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n' IGNORE 1 LINES;"
|
mysql -u$DB_USER -p$DB_PASS $DB_NAME -e"TRUNCATE Table BridgeInfo; LOAD DATA LOCAL INFILE '"$FILE_BASE"_info.csv' INTO TABLE BridgeInfo FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n' IGNORE 1 LINES;"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
jq -r "[.[]|{nukiId}+{name}+({lastKnownState}|.[])]|$JQ_CSV" "$FILE_BASE"_list.json > "$FILE_BASE"_list.csv
|
jq -r "[.[]|{nukiId}+{name}+({lastKnownState}|.[])]|$JQ_CSV" "$FILE_BASE"_list.json > "$FILE_BASE"_list.csv
|
||||||
sed -i 's/,true,/,1,/g' "$FILE_BASE"_list.csv
|
sed -i 's/true/1/g' "$FILE_BASE"_list.csv
|
||||||
sed -i 's/,false,/,0,/g' "$FILE_BASE"_list.csv
|
sed -i 's/false/0/g' "$FILE_BASE"_list.csv
|
||||||
mysql -u$DB_USER -p$DB_PASS $DB_NAME -e"TRUNCATE TABLE BridgeList; LOAD DATA LOCAL INFILE '"$FILE_BASE"_list.csv' INTO TABLE BridgeList FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n' IGNORE 1 LINES;"
|
mysql -u$DB_USER -p$DB_PASS $DB_NAME -e"TRUNCATE TABLE BridgeList; LOAD DATA LOCAL INFILE '"$FILE_BASE"_list.csv' INTO TABLE BridgeList FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n' IGNORE 1 LINES;"
|
||||||
|
|
||||||
|
|
||||||
@ -425,30 +437,73 @@ chmod 770 nuki_bridge_job-parser.sh
|
|||||||
#test the script
|
#test the script
|
||||||
./nuki_bridge_job-parser.sh
|
./nuki_bridge_job-parser.sh
|
||||||
```
|
```
|
||||||
### 5.3 Putting the scripts to autostart (rc.local)
|
### 5.3 Install scripts as service
|
||||||
```
|
```
|
||||||
vim /etc/rc.local
|
vim /opt/nuki/web/nuki-web.service
|
||||||
```
|
```
|
||||||
|
|
||||||
> /etc/rc.local
|
> /opt/nuki/web/nuki-web.service
|
||||||
```
|
```
|
||||||
if [ -f /aafirstboot ]; then /aafirstboot start ; fi
|
[Unit]
|
||||||
|
After=network.target
|
||||||
if [ -f /aafirstboot ]; then /aafirstboot start ; fi
|
Description=Nuki Web Service
|
||||||
|
|
||||||
nohup /opt/nuki/web/nuki_web_job.sh > /opt/nuki/web/nuki_web_job.log 2>&1 &
|
[Service]
|
||||||
nohup /opt/nuki/bridge/nuki_bridge_job-parser.sh > /opt/nuki/bridge/nuki_bridge_job-parser.log 2>&1 &
|
Type=simple
|
||||||
|
ExecStart=/opt/nuki/web/nuki_web_job.sh
|
||||||
exit 0
|
KillMode=process
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=10s
|
||||||
|
RemainAfterExit=yes
|
||||||
|
User=root
|
||||||
|
Group=root
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy= multi-user.target
|
||||||
```
|
```
|
||||||
|
|
||||||
### 5.4 Test it!
|
|
||||||
```
|
```
|
||||||
#reload
|
ln -sf /opt/nuki/web/nuki-web.service /etc/systemd/system/nuki-web.service
|
||||||
. /etc/rc.local & bash -c "ps -afe | grep [n]uki"
|
systemctl daemon-reload
|
||||||
|
systemctl enable nuki-web.service
|
||||||
|
|
||||||
|
service nuki-web restart && service nuki-web status
|
||||||
```
|
```
|
||||||
|
|
||||||
### 5.5 Customization parameters
|
```
|
||||||
|
vim /opt/nuki/bridge/nuki-bridge-parser.service
|
||||||
|
```
|
||||||
|
|
||||||
|
> /opt/nuki/bridge/nuki-bridge-parser.service
|
||||||
|
```
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
After=network.target
|
||||||
|
Description=Nuki Bridge Parser Service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/opt/nuki/bridge/nuki_bridge_job-parser.sh
|
||||||
|
KillMode=process
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=10s
|
||||||
|
RemainAfterExit=yes
|
||||||
|
User=root
|
||||||
|
Group=root
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy= multi-user.target
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
ln -sf /opt/nuki/bridge/nuki-bridge-parser.service /etc/systemd/system/nuki-bridge-parser.service
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl enable nuki-bridge-parser.service
|
||||||
|
|
||||||
|
service nuki-bridge-parser restart && service nuki-bridge-parser status
|
||||||
|
```
|
||||||
|
|
||||||
|
### 5.4 Customization parameters
|
||||||
|
|
||||||
* by adjusting the bash scripts you can modify the update frequency for CURLing and parsing json files (currently 30s is standard value)
|
* by adjusting the bash scripts you can modify the update frequency for CURLing and parsing json files (currently 30s is standard value)
|
||||||
* Bridge Id has to be added so the conjunction between Smartlock and Bridge can be established. This could be automated but at the moment it has to be done manually (replace in JQ parsing lines)
|
* Bridge Id has to be added so the conjunction between Smartlock and Bridge can be established. This could be automated but at the moment it has to be done manually (replace in JQ parsing lines)
|
||||||
|
Loading…
Reference in New Issue
Block a user