aboutsummaryrefslogtreecommitdiffstats
path: root/envbot
diff options
context:
space:
mode:
authorMárcio Silva <coadde at hyperbola dot info>2017-06-02 15:44:54 -0300
committerMárcio Silva <coadde at hyperbola dot info>2017-06-02 15:44:54 -0300
commitb4830e97ae51396ccaa9ca2acb469aef80094ae8 (patch)
treec069b1ef6f9189848726121afa8d815e4e56d138 /envbot
downloadhyperbot-b4830e97ae51396ccaa9ca2acb469aef80094ae8.tar.lz
hyperbot-b4830e97ae51396ccaa9ca2acb469aef80094ae8.tar.xz
hyperbot-b4830e97ae51396ccaa9ca2acb469aef80094ae8.zip
Add initial files from envbot v0.1-beta1
Diffstat (limited to 'envbot')
-rwxr-xr-xenvbot42
1 files changed, 42 insertions, 0 deletions
diff --git a/envbot b/envbot
new file mode 100755
index 0000000..a3de9e7
--- /dev/null
+++ b/envbot
@@ -0,0 +1,42 @@
+#!/usr/bin/env bash
+# -*- coding: utf-8 -*-
+###########################################################################
+# #
+# envbot - an IRC bot in bash #
+# Copyright (C) 2007-2008 Arvid Norlander #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###########################################################################
+#---------------------------------------------------------------------
+## This is a wrapper that runs envbot in a sane setup.<br />
+## Using a wrapper is really the simplest way to do it.
+#---------------------------------------------------------------------
+
+# Default config file
+config_file="bot_settings.sh"
+# Default place to load libraries from
+# Also where to load main envbot from. We won't accept any other location
+# for main.sh, but main.sh will for library scripts.
+library_dir="lib"
+
+# This work-around is needed on FreeBSD
+bash="$(type -p bash)"
+
+# Later arguments on the command line will override the defaults.
+
+# env -i: Clean environment
+# TERM="$TERM": But keep TERM
+# bash --norc: Don't read profile/bashrc
+exec env -i TERM="$TERM" REALHOME="$HOME" "$bash" --norc "${library_dir}/main.sh" --config "$config_file" --libdir "$library_dir" "$@"