chiark / gitweb /
keyfunc.sh.in: Export key label and owner as options to key generators.
[distorted-keys] / debian / distorted-keys.postinst
1 #! /bin/sh
2
3 set -e
4
5 user=keys
6 home=/var/lib/distorted-keys
7
8 ## Make sure the user exists.
9 if ! grep -q ^$user: /etc/passwd; then
10   adduser --quiet --system --group \
11     --disabled-password --shell /dev/token-shells/userv \
12     --no-create-home --home $home \
13     $user
14 fi
15
16 ## Make the home directory if we need to.
17 if [ ! -d $home ]; then
18   mkdir -p $home
19   chown $user:$user $home
20   chmod 2755 $home
21 fi