====== Download a Remote Config File and Delete it afterwards ====== A very simple Method to roll out configfiles on a bunch of Router: The Router will try to download a config file from a ftp server with a unique part in the URL. After the File was downloaded successfully it will be deleted on the remote ftp server. This way you won't have a endless download. This Script can be used with various triggers: periodicly every XX min, after wan-up, sdk-startup and so on /* DESC: The Router will try to download a config file from a ftp server with a unique part in the URL. * DESC: After the File was downloaded successfully it will be deleted on the remote ftp server * Copyright (C) 2017 JJ NetModule AG, Switzerland */ // ftp/http/ftps/https is possible here url="ftp://myfileserver.ch/"; user="ftpusername"; pw="ftppassword"; // Get Unique Part of the URL via Serial Number or Hostname //unique=nb_status("info").SERIAL_NUMBER; unique=nb_config_get("network.hostname"); // File name on the server image="cfg.zip"; // local file for storage local="configfile.zip"; //We will have a remote update Link like: ftp://myfileserver.ch/myhostname/cfg.zip link=sprintf("%s/%s/%s",url,unique,image); DELAY=120; TRIES=5; for (i=0;i