summaryrefslogtreecommitdiff
path: root/community/elasticsearch/elasticsearch.install
blob: 915acfadac3d85259d577329a3f5d3b4cd9deccc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
post_install() {
    getent group elasticsearch >/dev/null 2>&1 || groupadd -g 114 elasticsearch &>/dev/null
    getent passwd elasticsearch >/dev/null 2>&1 || useradd -u 114 -g elasticsearch -d /usr/share/elasticsearch -s /bin/false elasticsearch &>/dev/null

    chown -R elasticsearch:elasticsearch /usr/share/elasticsearch
}

post_upgrade(){
    getent group elasticsearch >/dev/null 2>&1 || groupadd -g 114 elasticsearch &>/dev/null
    getent passwd elasticsearch >/dev/null 2>&1 || useradd -u 114 -g elasticsearch -d /usr/share/elasticsearch -s /bin/false elasticsearch &>/dev/null
}

post_remove() {
    if getent passwd elasticsearch >/dev/null 2>&1; then
        userdel elasticsearch
    fi
    if getent group elasticsearch >/dev/null 2>&1; then
        groupdel elasticsearch
    fi
}