upsert bitwarden user

This commit is contained in:
Kyle Spearrin 2018-03-27 16:37:50 -04:00
parent 832ddddc58
commit 3c5022d628
1 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,14 @@
#!/bin/sh #!/bin/sh
useradd -r -u ${LOCAL_UID:-999} -g bitwarden bitwarden NOUSER=`id -u bitwarden > /dev/null 2>&1; echo $?`
LUID=${LOCAL_UID:-999}
if [[ $NOUSER == 0 && `id -u bitwarden` != $LUID ]]
then
usermod -u $LUID bitwarden
elif [ $NOUSER == 1 ]
then
useradd -r -u $LUID -g bitwarden bitwarden
fi
chown -R bitwarden:bitwarden /etc/bitwarden chown -R bitwarden:bitwarden /etc/bitwarden
cp /etc/bitwarden/web/settings.js /app/js/settings.js cp /etc/bitwarden/web/settings.js /app/js/settings.js