diff options
Diffstat (limited to 'murmur')
-rw-r--r-- | murmur/PKGBUILD | 45 | ||||
-rw-r--r-- | murmur/murmur-config.sh | 134 | ||||
-rw-r--r-- | murmur/murmur.install | 35 | ||||
-rw-r--r-- | murmur/murmurd | 40 |
4 files changed, 254 insertions, 0 deletions
diff --git a/murmur/PKGBUILD b/murmur/PKGBUILD new file mode 100644 index 0000000..bc5ee00 --- /dev/null +++ b/murmur/PKGBUILD @@ -0,0 +1,45 @@ +# Contributor: Sebastian.Salich@gmx.de +# Maintainer: Doc Angelo + +pkgname=murmur +pkgver=1.1.8 +pkgrel=1 +arch=('i686' 'x86_64') +pkgdesc="The voice chat application server for Mumble" +license=('GPL') +backup=('etc/murmurd.ini') +depends=('qt>=4.4.0' 'libcap') +makedepends=('pkgconfig') +conflicts=('mumble<=1.1.4' 'mumble-server') +options=('!libtool') +url="http://mumble.sourceforge.net/" +source=("http://downloads.sourceforge.net/mumble/mumble-$pkgver.tar.gz" \ + murmurd \ + murmur.install \ + murmur-config.sh) +md5sums=('a7da012922d39b87c45d9f481d4b5efb' + 'e3c7be4cc45ff64a7b9e36605ac24497' + '5a9f17491006e979037ac148a3881fe2' + 'ceb7bf98b02ce49837b2ea7640c4b68d') +install=murmur.install + +build() { + cd $srcdir/mumble-$pkgver + + # Building murmur + /usr/bin/qmake main.pro "CONFIG+=no-client no-ice" || exit 1 + make || exit 1 + + # create directories and copy files + install -m755 -D $startdir/murmurd $pkgdir/etc/rc.d/murmurd + install -m755 -D $startdir/murmur-config.sh $pkgdir/usr/bin/murmur-config.sh + install -m755 -D ./release/murmurd $pkgdir/usr/sbin/murmurd + install -m755 -d $pkgdir/usr/share/man/man1 + install -m644 -D ./man/mur* $pkgdir/usr/share/man/man1/ + install -m755 -d $pkgdir/var/lib/murmurd + + # copy and modify murmurd.ini + sed 's|database=|database=/var/lib/murmurd/murmurd.sqlite|g;s|#logfile=murmur.log|logfile=/var/log/murmurd.log|g' ./scripts/murmur.ini > ./scripts/murmurd.ini + install -m644 -D ./scripts/murmurd.ini $pkgdir/etc/ + rm ./scripts/murmurd.ini +} diff --git a/murmur/murmur-config.sh b/murmur/murmur-config.sh new file mode 100644 index 0000000..ebee4a4 --- /dev/null +++ b/murmur/murmur-config.sh @@ -0,0 +1,134 @@ +#!/bin/bash +# +# -> config.sh +# +# version: 1.1 +# author: Massimo Mund +# date: 21.12.2007 +# description: a script to easily add, remove and edit users from a murmur server +# + +#information +version="1.1" + +#settings +bin="sqlite3" +dbfile="/var/lib/murmurd/murmurd.sqlite" + +function checkforsqlite() { + + if [ ! -f /usr/bin/sqlite3 ]; then + echo "it seems that there is no sqlite3 installed, which is necessary for this script! " + echo "install sqlite3 and try it again!" + exit + fi + +} + +function help () { + + echo "" + echo " usage: config.sh <cmd> | --help | --version" + echo "" + echo " commands:" + echo " showusers" + echo " adduser <username> <pw> [<serverid>] [<email>]" + echo " deluser <username> [<serverid>]" + echo " setpw <username> <newpw> [<serverid>]" + echo " setemail <username> <newemail> [<serverid>]" + echo "" + exit + +} + +function version() { + + echo "config.sh : version: $1" + exit +} + +function invalidoption () { + + echo "config.sh : invalid option -- $*" + echo "Try 'config.sh --help' for more information." + exit + +} + +checkforsqlite + +while [ "$#" -gt "0" ]; do + case $1 in + showusers) + $bin $dbfile "select * from players;" + exit + ;; + adduser) + shift + username="$1" + email="$4" + pw="$2" + serverid="$3" + playerid=$($bin $dbfile "select MAX(player_id)+1 as id from players WHERE player_id < 10000;") + + if [ "$serverid" == "" ]; then + serverid="1" + fi + + $bin $dbfile "insert into players (server_id, player_id, name, email, pw) values($serverid, $playerid, '$username', '$email', '$pw');" + exit + ;; + deluser) + shift + username="$1" + serverid="$2" + + if [ "$serverid" == "" ]; then + serverid="1" + fi + + $bin $dbfile "delete from players where name='$username';" + exit + ;; + setpw) + shift + username="$1" + newpw="$2" + serverid="$3" + + if [ "$serverid" == "" ]; then + serverid="1" + fi + + $bin $dbfile "update players set pw='$newpw' where name='$username';" + exit + ;; + setemail) + shift + username="$1" + newemail="$2" + serverid="$3" + + if [ "$serverid" == "" ]; then + serverid="1" + fi + + $bin $dbfile "update players set email='$newemail' where name='$username';" + exit + ;; + --help) + help + ;; + --version) + version $version + ;; + *) + invalidoption $* + break + ;; + esac +done + +invalidoption $* + +exit 0 diff --git a/murmur/murmur.install b/murmur/murmur.install new file mode 100644 index 0000000..d940c64 --- /dev/null +++ b/murmur/murmur.install @@ -0,0 +1,35 @@ +# arg 1: the new package version +pre_install() { + /bin/true +} + +post_install() { + echo ' -> The user SuperUser has a blank password! You can change' + echo ' -> this and administrate users with murmur-config.sh.' + echo '' +} + +# arg 1: the new package version +# arg 2: the old package version +pre_upgrade() { + /bin/true +} + +post_upgrade() { + /bin/true +} + +# arg 1: the old package version +pre_remove() { + /bin/true +} + +# arg 1: the old package version +post_remove() { + /bin/true +} + +op=$1 +shift +$op $* +
\ No newline at end of file diff --git a/murmur/murmurd b/murmur/murmurd new file mode 100644 index 0000000..630b49f --- /dev/null +++ b/murmur/murmurd @@ -0,0 +1,40 @@ +#!/bin/bash + +# general config +. /etc/rc.conf +. /etc/rc.d/functions + +PID=`pidof -o %PPID /usr/sbin/murmurd` + +case "$1" in + start) + stat_busy "Starting Murmur Server" + [ -z $PID ] && /usr/sbin/murmurd -ini /etc/murmurd.ini & > /dev/null 2>&1 + if [ $? -gt 0 ]; then + stat_fail + else + PID=`pidof -o %PPID /usr/sbin/murmurd` + echo $PID >/var/run/murmurd.pid + add_daemon murmurd + stat_done + fi + ;; + stop) + stat_busy "Stopping Murmur Server" + [ ! -z $PID ] && kill $PID & > /dev/null 2>&1 + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon murmurd + stat_done + fi + ;; + restart) + $0 stop + sleep 3 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 |