summarylogtreecommitdiffstats
path: root/newrelic-php5.install
blob: db0a0d424ddbf9678da054c837dc4a7d96975fdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
post_install() {
    # Setup "newrelic"
    useradd --system -M --home / --shell /sbin/nologin newrelic || true

    # Setup permissions
    mkdir -p /var/log/newrelic
    chmod 755 /var/log/newrelic

    # When first installing the package, the license key will not be set.
    # Instead of throwing an error, we want to whine to the user and then exit cleanly.
    if sed -e '/^[        ]*#/d' "${inifile}" 2>/dev/null | grep -q 'REPLACE_WITH_REAL_KEY' 2>/dev/null; then
        if [ -z "${NR_SILENT}" ] && [ -z "${SILENT}" ]; then
            echo "
:: The service cannot be started until a valid licence is detected in:

   /etc/php/conf.d/newrelic.ini

:: Edit the above file and replace \"newrelic.license\" parameter with your licence key.
:: More information here:

   https://docs.newrelic.com/docs/apm/agents/php-agent/installation/php-agent-installation-overview/#install-overview
"
        fi
        return 0
    fi
}

post_remove() {
    userdel newrelic || true
}