X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=blootbot%2Fblootbot;h=5e656e774506d90efefafe986478c3a05f6eb1c5;hb=f156cead4c86030d3f9533ce43c682d7526fbf74;hp=02ea59b528a5247a23385d019a426d9962ec04dc;hpb=f2ba63c8bfbc17a646a16acdfbbe009b68b105c3;p=infobot.git diff --git a/blootbot/blootbot b/blootbot/blootbot index 02ea59b..5e656e7 100755 --- a/blootbot/blootbot +++ b/blootbot/blootbot @@ -6,25 +6,24 @@ use strict; use vars qw($bot_base_dir $bot_src_dir $bot_misc_dir $bot_state_dir $bot_data_dir $bot_config_dir $bot_log_dir $bot_run_dir - $bot_pid $memusage %param $fhs + $bot_pid $memusage %param ); 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 = $$;