From 7a2794d309198a195d3c07a8cf9316f16531cd9f Mon Sep 17 00:00:00 2001 From: miljenko Date: Mon, 5 Dec 2005 10:04:01 +0000 Subject: [PATCH] Added support for user configuration file: .imunesrc or $HOME/.imunesrc Bug found by: Submitted by: Requested by: Reviewed by: Approved by: Obtained from: --- filemgmt.tcl | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/filemgmt.tcl b/filemgmt.tcl index ccd8c26..80f19de 100755 --- a/filemgmt.tcl +++ b/filemgmt.tcl @@ -192,3 +192,31 @@ proc fileSaveAsDialogBox {} { saveFile $selectedFile } + + +# +# Read config files, the first one found: .imunesrc, $HOME/.imunesrc +# +# list of exec_hosts +# Options / variables: +# remote_exec +# 0 - for local execution on FreeBSD, +# 1 - IMUNES GUI is on remote (even if exec_host=localhost) +# editor_only +# +proc readConfigFile {} { + global exec_hosts remote_exec editor_only + if { [file exists ".imunesrc"] } { + source ".imunesrc" + } else { + if { [catch {$env(HOME)} home] } { + # not running on UNIX + } else { + if { [file exists "$home/.imunesrc"] } { + source "$home/.imunesrc" + } + } + } +} + + -- 2.39.5