File: speech-dispatcher.postinst

package info (click to toggle)
speech-dispatcher 0.12.0-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 36,828 kB
  • sloc: ansic: 27,709; sh: 5,404; python: 1,224; makefile: 1,041; lisp: 583; cpp: 404
file content (45 lines) | stat: -rw-r--r-- 1,391 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh
set -e

USER_NAME=speech-dispatcher
HOME_DIR=/run/speech-dispatcher

if ! id -u $USER_NAME >/dev/null 2>&1; then
  adduser --quiet --system --ingroup audio \
          --home $HOME_DIR \
          --shell /bin/false --disabled-login  \
	  --gecos 'Speech Dispatcher' $USER_NAME
elif ! test -d $HOME_DIR; then
  if test -d /run/speechd; then
    mv /run/speechd $HOME_DIR
  else
    mkdir $HOME_DIR
  fi
  usermod --shell /bin/false $USER_NAME
fi

if [ -d /var/log/speech-dispatcher ]; then
  chown $USER_NAME /var/log/speech-dispatcher
fi

#DEBHELPER#

if [ -z "$(dpkg-query -f '${Version}' -W speech-dispatcher-baratinoo 2> /dev/null)" ]
then
	dpkg-maintscript-helper rm_conffile /etc/speech-dispatcher/modules/baratinoo.conf 0.10.2-1\~ speech-dispatcher -- "$@"
fi

if [ -z "$(dpkg-query -f '${Version}' -W speech-dispatcher-ibmtts 2> /dev/null)" ]
then
	dpkg-maintscript-helper rm_conffile /etc/speech-dispatcher/modules/ibmtts.conf 0.10.2-1\~ speech-dispatcher -- "$@"
fi

if [ -z "$(dpkg-query -f '${Version}' -W speech-dispatcher-kali 2> /dev/null)" ]
then
	dpkg-maintscript-helper rm_conffile /etc/speech-dispatcher/modules/kali.conf 0.10.2-1\~ speech-dispatcher -- "$@"
fi

# clean up dynamically created alias symlink which is now shipped in the package itself
if dpkg --compare-versions "$2" lt "0.11.5-5.1~"; then
	rm -f /etc/systemd/system/speech-dispatcher.service
fi