File: swordfish.preinst

package info (click to toggle)
swordfish 0.12-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 736 kB
  • ctags: 204
  • sloc: sh: 1,470; ansic: 1,404; python: 510; makefile: 25
file content (38 lines) | stat: -rw-r--r-- 669 bytes parent folder | download
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
#!/bin/sh

set -eu

USER="swordfsh"
GROUP="$USER"
HOME="/var/lib/swordfish"

mkdir -p /var/log/swordfish

# If we use NIS then errors should be tolerated.
if which ypwhich >/dev/null 2>&1 && ypwhich >/dev/null 2>&1
then
	set +e
fi

if ! getent group $GROUP >/dev/null
then
	addgroup --system $GROUP >/dev/null
fi

# creating user if it isn't already there
if ! getent passwd $USER >/dev/null
then
        adduser \
          --system \
          --disabled-login \
          --ingroup $GROUP \
          --home $HOME \
          --gecos "swordfish server" \
          --shell /bin/false \
          $USER  >/dev/null
fi

# end of NIS tolerance zone
set -e

#DEBHELPER#