]> git.donarmstrong.com Git - infobot.git/commitdiff
- fhs changes
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Mon, 8 Oct 2001 13:02:49 +0000 (13:02 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Mon, 8 Oct 2001 13:02:49 +0000 (13:02 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@523 c11ca15a-4712-0410-83d8-924469b57eb5

blootbot

index 02ea59b528a5247a23385d019a426d9962ec04dc..f39ba08b83bb390f1794e593c549f5853f937670 100755 (executable)
--- a/blootbot
+++ b/blootbot
@@ -12,19 +12,20 @@ use vars qw($bot_base_dir $bot_src_dir $bot_misc_dir $bot_state_dir
 BEGIN {
     $fhs = 0;
 
-    if ($fhs) {        # FHS
-       $bot_base_dir   = $bot_state_dir;
-       $bot_config_dir = '.';
-    } else {   # non-FHS
-       $bot_base_dir   = '.';
-       $bot_config_dir = 'files/';
-       $bot_data_dir   = 'files/';
-       $bot_state_dir  = 'files/';
-       $bot_run_dir    = '.';
+    if (@ARGV and -f $ARGV[0]) {
+       # source passed config to allow $bot_*_dir to be set.
+       do $ARGV[0];
     }
-    # common.
-    $bot_src_dir       = "$bot_base_dir/src";
-    $bot_misc_dir      = "$bot_base_dir/files";
+
+    # set any $bot_*_dir var's that aren't already set
+    $bot_base_dir      ||= '.';
+    $bot_config_dir    ||= 'files/';
+    $bot_data_dir      ||= 'files/';
+    $bot_state_dir     ||= 'files/';
+    $bot_run_dir       ||= '.';
+    $bot_src_dir       ||= "$bot_base_dir/src";
+    $bot_log_dir       ||= "$bot_base_dir/log";
+    $bot_misc_dir      ||= "$bot_base_dir/files";
 
     $bot_pid           = $$;