diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2012-01-18 12:27:37 -0500 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2012-01-18 12:27:37 -0500 |
| commit | f70165ef6229a92bf8cfa6f16eff980a4a7491fe (patch) | |
| tree | e2954759f71c0b4c482334ba9b278a4224e97197 /misc | |
| parent | 0ce9f4fb84693f34113630c59610b47a082ae71a (diff) | |
| download | alias-f70165ef6229a92bf8cfa6f16eff980a4a7491fe.tar.gz | |
Added setup.py and big reorg of the source tree
this should fix tickets #10 and #11
Diffstat (limited to 'misc')
| -rw-r--r-- | misc/alias | 58 | ||||
| -rw-r--r-- | misc/config.ini.sample | 9 |
2 files changed, 67 insertions, 0 deletions
diff --git a/misc/alias b/misc/alias new file mode 100644 index 0000000..208401b --- /dev/null +++ b/misc/alias @@ -0,0 +1,58 @@ +#!/bin/sh + +DAEMON=/usr/bin/alias-server +PIDFILE=/var/run/alias.pid +CONFIG=/etc/alias/config.ini + +if [ ! -x $DAEMON ]; then + echo "ERROR: Can't execute $DAEMON." + exit 1 +fi + +start_service() { + echo -n " * Starting alias server... " + start-stop-daemon -Sq -p $PIDFILE -x $DAEMON -- -c $CONFIG + e=$? + if [ $e -eq 1 ]; then + echo "already running" + return + fi + + if [ $e -eq 255 ]; then + echo "couldn't start :(" + return + fi + + echo "done" +} + +stop_service() { + echo -n " * Stopping alias server... " + start-stop-daemon -Kq -R 10 -p $PIDFILE + e=$? + if [ $e -eq 1 ]; then + echo "not running" + return + fi + + echo "done" +} + +case "$1" in + start) + start_service + ;; + stop) + stop_service + ;; + restart) + stop_service + start_service + ;; + *) + echo "Usage: /etc/init.d/alias {start|stop|restart}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/misc/config.ini.sample b/misc/config.ini.sample new file mode 100644 index 0000000..66dde3a --- /dev/null +++ b/misc/config.ini.sample @@ -0,0 +1,9 @@ +[component] +name = testg.alias.im +secret = Mvdujq06 +host = alias.im +port = 5349 +root = /var/lib/alias/ +background = True +logfile = /var/log/alias.log +pidfile = /var/run/alias.pid |
