]> git.entuzijast.net Git - imunes.git/commitdiff
Added support for user configuration file: .imunesrc or $HOME/.imunesrc
authormiljenko <miljenko>
Mon, 5 Dec 2005 10:04:01 +0000 (10:04 +0000)
committermiljenko <miljenko>
Mon, 5 Dec 2005 10:04:01 +0000 (10:04 +0000)
Bug found by:
Submitted by:
Requested by:
Reviewed by:
Approved by:
Obtained from:

filemgmt.tcl

index ccd8c267ff423f475860957c31e42e3aa49e77fa..80f19def4be407a18f3c3b813f81c6d0f8c62359 100755 (executable)
@@ -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"
+            }
+        }
+    }
+}
+
+