summarylogtreecommitdiffstats
path: root/glassfish-web-v4.install
blob: 31008d689a7810b1d7b542b6583d42e92cdce308 (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
post_install() {
  systemctl daemon-reload
}

pre_remove() {
  systemctl is-enabled glassfish-web.service > /dev/null 2>&1
  is_enabled=$?
  systemctl status glassfish-web.service > /dev/null 2>&1
  is_running=$?

  if [ $is_enabled -eq 0 ]; then
    systemctl disable glassfish-web.service > /dev/null 2>&1
  fi

  if [ $is_running -eq 0 ]; then
    systemctl stop glassfish-web.service > /dev/null 2>&1
  fi
}

post_remove() {
  if [ -d "$pkgdir/opt/glassfish4-web" ]; then
    /bin/echo -e "\e[1;31mNOTICE:\e[0m You may want to delete directory \e[1;31m$pkgdir/opt/glassfish4-web\e[0m"
  fi
}