From 45b134f897572318f182aa5faa348c5bd39fa7ae Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Tue, 4 Dec 2012 01:12:15 +0000 Subject: ftpupload: decouple ftpupload from modbuslog Allow ftpupload to be used as an independent program. This enables it to be used by both modbuslog and phidgetcontrol. The ftp stanza in /etc/modbuslog has been split out into a separate ftpupload configuration file located at /etc/ftpupload. ftpupload now reads the $UPLOADTYPE variable to determine which type of upload to execute. If $UPLOADTYPE has not been set, ftpupload will default to modbuslog. --- src/ftpupload | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ftpupload') diff --git a/src/ftpupload b/src/ftpupload index 7c612d5..f02e269 100755 --- a/src/ftpupload +++ b/src/ftpupload @@ -7,7 +7,8 @@ USERNAME=`/usr/bin/ftphelper --username` PASSWORD=`/usr/bin/ftphelper --password` SERVER=`/usr/bin/ftphelper --server` -LOCALDIRECTORY="/var/modbuslog" +# default to modbuslog if unset +LOCALDIRECTORY="/var/${UPLOADTYPE-modbuslog}" REMOTEDIRECTORY=`/usr/bin/ftphelper --directory` # current file to be uploaded -- cgit v1.2.3