summarylogtreecommitdiffstats
path: root/adchpp.install
blob: 462a57b250b8c3e14302c033a2f736f1fe9a93ca (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
all_off="$(tput sgr0)"
bold="${all_off}$(tput bold)"
yellow="${bold}$(tput setaf 3)"
blue="${bold}$(tput setaf 4)"
green="${bold}$(tput setaf 2)"

post_install() {
  post_upgrade $1
}

post_upgrade() {
  install -dm744 -o adchpp -g adchpp /var/log/adchpp
  install -dm744 -o adchpp -g adchpp /var/lib/adchpp
}

post_remove() {
  paths=(/etc/adchpp /var/lib/adchpp /var/log/adchpp)

  first=true
  for path in ${paths[@]}; do
    if [ -d $path ]; then
      if $first; then
        first=false
        printf "${green}==>${all_off} ${bold}Leftover Paths:${all_off}\n"
      fi
      printf "${blue}  -> ${all_off} ${bold}$path${all_off}\n"
    fi
  done
}