2018-03-28 03:14:52 +02:00
|
|
|
#!/bin/bash
|
2017-08-07 22:31:00 +02:00
|
|
|
|
2018-03-27 22:38:11 +02:00
|
|
|
NOUSER=`id -u bitwarden > /dev/null 2>&1; echo $?`
|
|
|
|
LUID=${LOCAL_UID:-999}
|
2018-03-27 23:16:25 +02:00
|
|
|
if [ $NOUSER == 0 ] && [ `id -u bitwarden` != $LUID ]
|
2018-03-27 22:38:11 +02:00
|
|
|
then
|
|
|
|
usermod -u $LUID bitwarden
|
|
|
|
elif [ $NOUSER == 1 ]
|
|
|
|
then
|
|
|
|
useradd -r -u $LUID -g bitwarden bitwarden
|
|
|
|
fi
|
2018-03-27 20:55:33 +02:00
|
|
|
|
|
|
|
chown -R bitwarden:bitwarden /etc/bitwarden
|
2017-08-07 22:31:00 +02:00
|
|
|
cp /etc/bitwarden/nginx/default.conf /etc/nginx/conf.d/default.conf
|
2018-03-27 20:55:33 +02:00
|
|
|
mkdir -p /etc/letsencrypt
|
|
|
|
chown -R bitwarden:bitwarden /etc/letsencrypt
|
|
|
|
mkdir -p /etc/ssl
|
|
|
|
chown -R bitwarden:bitwarden /etc/ssl
|
|
|
|
touch /var/run/nginx.pid
|
2018-03-27 22:38:11 +02:00
|
|
|
chown -R bitwarden:bitwarden /var/run/nginx.pid
|
2018-03-27 20:55:33 +02:00
|
|
|
chown -R bitwarden:bitwarden /var/cache/nginx
|
2018-03-28 03:37:35 +02:00
|
|
|
chown -R bitwarden:bitwarden /var/log/nginx
|
2018-03-27 20:55:33 +02:00
|
|
|
|
|
|
|
gosu bitwarden:bitwarden nginx -g 'daemon off;'
|