Upload Config: Unterschied zwischen den Versionen

Aus Gude Systems GmbH
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „If you want to configuer multiple devices the same way, you can use a CLI file. Here, we want to enable NTP Client and eine Timer Rule enabled in multiple dev…“)
 
Zeile 1: Zeile 1:
If you want to configuer multiple devices the same way, you can use a CLI file.
+
If you want to confugure multiple devices the same way, you can upload a CLI file. Here, we want to enable NTP Client and one Timer Rule enabled in multiple devices identically
 +
config.txt sets up the configuration, upload.sh is used to upload the config and reboot to apply:
  
Here, we want to enable NTP Client and eine Timer Rule enabled in multiple devices the same way, using config.txt to set up the configuration, and upload.sh to upload the config and reboot to apply:
+
   ./upload.sh config.txt 192.168.0.2
 
+
   ./upload.sh config.txt 192.168.0.3
   ./upload.sh '''config.txt''' '''192.168.0.2'''
+
   ./upload.sh config.txt 192.168.0.4
   ./upload.sh '''config.txt''' '''192.168.0.3'''
 
   ./upload.sh '''config.txt''' '''192.168.0.4'''
 
  
  

Version vom 12. August 2019, 16:05 Uhr

If you want to confugure multiple devices the same way, you can upload a CLI file. Here, we want to enable NTP Client and one Timer Rule enabled in multiple devices identically config.txt sets up the configuration, upload.sh is used to upload the config and reboot to apply:

 ./upload.sh config.txt 192.168.0.2
 ./upload.sh config.txt 192.168.0.3
 ./upload.sh config.txt 192.168.0.4


config.txt

# Enable NTP Client
clock ntp server 0 set "0.pool.ntp.org"
clock ntp server 1 set "1.pool.ntp.org"
clock ntp enabled set 1


# Delete all Pre-Configured Timers
timer delete all


# Set Up New Timer:
# Timer1: Mo-Fr from 09:00:00 to 17:00:00 : Port 1 ON

timer 1 name set "Port1 on from 9to5 weekdays" 
timer 1 trigger HOUR set "9"
timer 1 trigger MIN  set "0"
timer 1 trigger SEC  set "0"
timer 1 trigger DAY  set "ALLSET"
timer 1 trigger MON  set "ALLSET"
timer 1 trigger DOW  set "0,1,2,3,4"

timer 1 action mode set SWITCH
timer 1 action SWITCH1 ON  set "1" 
timer 1 action SWITCH2 OFF set "1"
timer 1 action delay set 28800 
timer 1 enabled set 1

# Start Timer engine
timer enabled set ON

upload.sh

#!/bin/bash

# Upload Config File
curl -F file=@./$1 "http://$2/fwupdate.txt?type=2"

# Rebot to apply
curl "http://$2/status.json?cmd=39"