summarylogtreecommitdiffstats
path: root/grafana.install
blob: 56563086ff8e12574cefebb45d895d55a087fca7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#/bin/sh

# arg 1:  the new package version
# arg 2:  the old package version
post_upgrade() {
  if (( "$(vercmp $2 2.6.0-3)" < 0 )); then
    echo '==> Configuration moved to /etc/grafana.ini'
  fi
  if (( "$(vercmp $2 4.4.3-1)" < 0 )); then
    echo '==> Grafana now uses static UID/GID 207'
    echo '==> Trying to update your previous UID/GID'
    if ! { usermod -u 207 grafana && groupmod -g 207 grafana &&
      chown -R 207:207 /var/{lib,log}/grafana; }; then
      echo '==> Automatic GID/UID change failed. Do it manually!'
      echo '==> usermod -g 207 grafana && groupmod -u 207 grafana && chown -R 207:207 /var/l{ib,og}/grafana'
    fi
    echo '==> Check the ownership of your files!'
  fi
  return 0
}

# vim:set ts=2 sw=2 et: