~ubuntu-branches/ubuntu/karmic/mumble/karmic-updates

« back to all changes in this revision

Viewing changes to scripts/murmur-user-wrapper

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Matthäi, Patrick Matthäi, Thorvald Natvig
  • Date: 2009-02-04 10:32:16 UTC
  • mfrom: (1.2.1 upstream) (4.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090204103216-vqx5fmlruwzn3uh2
[ Patrick Matthäi ]
* Add a mumble-dbg package, which contains the debugging symbols of mumble
  and mumble-server.
* Move swedish translation debian/sv.po to debian/po/sv.po.
  This was a bad error of mine.
* Remove debian/patches and dpatch, everything has been merged by upstream.

[ Thorvald Natvig ]
* New upstream release.
  Closes: #513119
* Added Spanish translation from Álvaro M. Recio
* Synchronized copyright

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/bash
2
2
 
3
3
DIR=$HOME/murmur
4
 
DBUSFILE=$DIR/.dbus.sh
5
4
SYSDIR=/usr/share/doc/mumble-server/examples
6
5
 
7
6
if [ $UID == 0 ] || [ $EUID == 0 ]; then
8
7
  echo "You should never run this script as root. If you want a system-wide install, see "
9
8
  echo "the documentation included with this package."
10
 
  exit
 
9
  exit 2
11
10
fi
12
11
 
13
12
unset SETPW
33
32
                DO_KILL=1
34
33
                ;;
35
34
        *)
36
 
                exit
 
35
                exit 2
37
36
                ;;
38
37
  esac
39
38
done
 
39
DBUSFILE=$DIR/.dbus.sh
40
40
 
41
41
if [ $DO_KILL == 1 ]; then
42
42
        if pkill -U $UID -u $EUID -o -x -f "/usr/sbin/murmurd -ini $DIR/murmur.ini"; then
43
43
                echo "Termination signal sent"
44
44
        else
45
45
                echo "Murmur process not found; not terminated"
 
46
        exit 2
46
47
        fi
47
 
        exit
 
48
        exit 0
48
49
fi
49
50
 
50
51
if [ ! -d $DIR ]; then
52
53
  mkdir -m 0700 $DIR
53
54
fi
54
55
 
55
 
cd $DIR
 
56
cd $DIR || exit 2
56
57
 
57
58
if [ ! -f $DIR/murmur.ini ]; then
58
59
  echo "Creating $DIR/murmur.ini"
62
63
    gzip -cd $SYSDIR/murmur.ini.gz > $DIR/murmur.ini
63
64
  else
64
65
    echo "Could not find template for murmur.ini in $SYSDIR."
65
 
    exit
 
66
    exit 2
66
67
  fi
67
68
elif [ $DO_INITONLY == 1 ]; then
68
69
  echo "$DIR/murmur.ini already exists, initialization failed."
69
 
  exit
 
70
  exit 2
70
71
fi
71
72
 
72
73
if [ $DO_INITONLY == 1 ]; then
73
74
  echo "Initialization done. Please edit $DIR/murmur.ini"
74
 
  exit
 
75
  exit 0
75
76
fi
76
77
 
77
78
if [ "X$SETPW" != "X" ]; then
78
79
        echo "Setting superuser password to \"$SETPW\""
79
80
        /usr/sbin/murmurd -ini $DIR/murmur.ini -supw $SETPW
80
 
        exit
 
81
        exit 0
81
82
fi
82
83
 
83
84
PID=$(pgrep -U $UID -u $EUID -o -x -f "/usr/sbin/murmurd -ini $DIR/murmur.ini")
94
95
 
95
96
if [ "X$PID" != "X" ]; then
96
97
  echo "Murmur is already running."
97
 
  exit
 
98
  exit 1
98
99
fi
99
100
 
100
101
DBUS_SESSION_BUS_ADDRESS=invalid:/
106
107
  . $DBUSFILE
107
108
  if ! dbus-send --print-reply --dest=org.freedesktop.DBus --type=method_call / org.freedesktop.DBus.GetId 2> /dev/null > /dev/null; then
108
109
    echo "Failed to launch session DBUS, bailing out."
109
 
    exit
 
110
    exit 2
110
111
  fi
111
112
fi
112
113
 
113
114
echo "Starting Murmur"
114
 
/usr/sbin/murmurd -ini $DIR/murmur.ini
 
115
exec /usr/sbin/murmurd -ini $DIR/murmur.ini