From 12164f4a688b5c9a0b76e05a38fa764522934706 Mon Sep 17 00:00:00 2001 From: Roy Kaldung Date: Mon, 19 Oct 2015 19:05:42 +0200 Subject: [PATCH] add user w/ rpm installation --- INSTALL.md | 5 +++++ extras/zammad.spec | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 INSTALL.md diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 000000000..1783f3038 --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,5 @@ +Installation +============ + +* Prepare yum repository for Elasticsearch. Use then manual described [https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html#_yum](https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html#_yum) +* diff --git a/extras/zammad.spec b/extras/zammad.spec index 9d4b9ebeb..4e6d8c914 100644 --- a/extras/zammad.spec +++ b/extras/zammad.spec @@ -70,15 +70,15 @@ export OTRSUSER=otrs # cat /opt/otrs/RELEASE|grep VERSION|sed 's/VERSION = //'|sed 's/ /-/g' > /tmp/otrs-old.tmp #fi # useradd -export OTRSUSER=zammad +export ZUSER=zammad echo -n "Check OTRS user ... " -#if id $OTRSUSER >/dev/null 2>&1; then -# echo "$OTRSUSER exists." -# # update home dir -# usermod -d /opt/otrs $OTRSUSER -#else -# useradd $OTRSUSER -d /opt/otrs/ -s /bin/bash -g zammad -c 'Zammad user' && echo "$OTRSUSER added." -#fi +if id $ZUSER >/dev/null 2>&1; then + echo "$ZUSER exists." + # update home dir + usermod -d /opt/zammads $ZUSER +else + useradd $ZUSER -d /opt/zammad -s /bin/bash -g zammad -c 'Zammad user' && echo "$ZUSER added." +fi %post