Browse Source

Restructure

Joachim M. Giæver 3 years ago
parent
commit
c57616e19d
2 changed files with 14 additions and 12 deletions
  1. 4 2
      snap/snapcraft.yaml
  2. 10 10
      src/hooks/install

+ 4 - 2
snap/snapcraft.yaml

@@ -20,7 +20,9 @@ plugs:
 apps:
    ozwdaemon:
      command: bin/wrapper
-     plugs: [network, docker]
+     plugs: 
+      - network
+      - docker
 
 parts:
   ozwdaemon:
@@ -28,4 +30,4 @@ parts:
     source: src/
     organize:
       wrapper: bin/
-      hooks: snap/
+      hooks: snap/hooks

+ 10 - 10
src/hooks/install

@@ -2,16 +2,16 @@
 
 set -e
 
-snapctl set usb-path /dev/ttyUSB0
+snapctl set usb-path=/dev/ttyUSB0
 
-snapctl set mqtt.server localhost
-snapctl set mqtt.port 1883
-snapctl set mqtt.username username
-snapctl set mqtt.password password
-snapctl set mqtt.tls false
-snapctl set mqtt.connect-timeout 30
+snapctl set mqtt.server=localhost
+snapctl set mqtt.port=1883
+snapctl set mqtt.username=username
+snapctl set mqtt.password=password
+snapctl set mqtt.tls=false
+snapctl set mqtt.connect-timeout=30
 
-snapctl set stop-on-failure true
+snapctl set stop-on-failure=true
 
 KEY=$(cat /dev/urandom | tr -dc '0-9A-F' | fold -w 32 | head -n 1 | sed -e 's/\(..\)/0x\1, /g' -e 's/, $//')
 
@@ -19,5 +19,5 @@ if [ $? -ne 0 ];
     KEY="0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00"
 fi;
 
-snapctl set ozw.network-key "${KEY}"
-snapctl get ozw.instance 1
+snapctl set ozw.network-key="${KEY}"
+snapctl get ozw.instance=1