freenetis-dhcp-github/freenetis-dhcp-sync.rsc @ c988d1b0
2d5f1ecd | Ondřej Fibich | ################################################################################
|
|
# #
|
|||
# Author: Michal Kliment #
|
|||
# Description: This script regenerate DHCP server from FreenetIS #
|
|||
# #
|
|||
# Version: 0.1.3 #
|
|||
# #
|
|||
################################################################################
|
|||
c95784dc | Ondřej Fibich | ||
2d5f1ecd | Ondřej Fibich | ############ CONFIG VALUES #####################################################
|
|
c95784dc | Ondřej Fibich | ||
# Base PATH_FN to running FreenetIS instance
|
|||
:global PATHFN "http://localhost/freenetis"
|
|||
# ID of device from FreenetIS
|
|||
:global DEVICEID 0
|
|||
# Forced download
|
|||
:global FORCED 0
|
|||
2d5f1ecd | Ondřej Fibich | ############ SCRIPT - DO NOT CHANGE! ###########################################
|
|
c95784dc | Ondřej Fibich | ||
# First run with forced download
|
|||
:if ([:len [/file find name="dhcp.rsc"]] = 0) do={
|
|||
:set FORCED 1
|
|||
}
|
|||
# Download script from FreenetIS
|
|||
/tool fetch url="$PATHFN/en/devices/export/$DEVICEID/mikrotik-ip-dhcp-server/text/$FORCED" dst-path="dhcp.rsc"
|
|||
# Waiting to end of downloading
|
|||
:delay 3
|
|||
# Run script
|
|||
2d5f1ecd | Ondřej Fibich | import dhcp.rsc
|