aboutsummaryrefslogtreecommitdiffstats
path: root/src/ftpupload
diff options
context:
space:
mode:
authorJonathan McCrohan <jmccrohan@gmail.com>2012-12-04 01:12:15 +0000
committerJonathan McCrohan <jmccrohan@gmail.com>2012-12-04 01:29:32 +0000
commit45b134f897572318f182aa5faa348c5bd39fa7ae (patch)
tree1dec0092e27d994750b39b809e88182515e4e705 /src/ftpupload
parent9083b82a25bdb9c25e7da0cfb4ebe515186c71e1 (diff)
downloadverteco-45b134f897572318f182aa5faa348c5bd39fa7ae.tar.gz
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.
Diffstat (limited to '')
-rwxr-xr-xsrc/ftpupload3
1 files changed, 2 insertions, 1 deletions
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