diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-02-02 18:49:39 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-02-03 15:12:39 +0200 |
commit | b3484417a14ba8aa65b0a6ba5a32edddc486f623 (patch) | |
tree | 073cbba4da700a861af23a11909a19b3f105201f /debian | |
parent | d75da025a9b06da6768c543975a1409b624274b6 (diff) | |
download | qvisqve-b3484417a14ba8aa65b0a6ba5a32edddc486f623.tar.gz |
Add: Debian postinst script to create _salami user
Diffstat (limited to 'debian')
-rw-r--r-- | debian/salami.postinst | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/debian/salami.postinst b/debian/salami.postinst new file mode 100644 index 0000000..f905b78 --- /dev/null +++ b/debian/salami.postinst @@ -0,0 +1,38 @@ +#!/bin/sh +# Copyright 2018 Lars Wirzenius +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +set -eu + + +create_user() +{ + local name="$1" + local logdir="$2" + + addgroup --force "$name" || true + adduser --disabled-login --disabled-password \ + --gecos "Ick CI" \ + --shell /bin/true --force \ + --ingroup "$name" \ + "$name" || true + install -d -m 0755 -o "$name" -g "$name" "$logdir" +} + + +# Create a group and user for Salami +create_user _salami /var/log/salami + +#DEBHELPER# |