#/bin/bash

# arg 1:  the new package version
# arg 2:  the old package version
post_upgrade() {
  # change uid of old version
  if (( $(vercmp $2 3.2.1-8) < 0 )); then
    if pgrep -u backuppc >/dev/null; then
      echo '==> backuppc user is running.'
      echo '==> You must manually change uid and gid of backuppc!'
      echo '==> e.g: usermod -u 126 -g 126 backuppc'
    else
      usermod -u 126 -g 126 backuppc
      echo '==> backuppc uid/gid have changed. Check your filesystem permissions.'
    fi
  fi
  if (( $(vercmp $2 4.0.0-1) <= 0 )); then
    echo '==> Major update. Remember to merge new variables in config.pl!'
  fi
  :
}

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