Commit | Line | Data |
---|---|---|
f012ad83 MW |
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 \ | |
fef0a02f | 11 | --disabled-password --shell /dev/token-shells/userv \ |
f012ad83 MW |
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 |