diff options
author | Gustavo Alvarez | 2016-04-27 17:57:45 +0200 |
---|---|---|
committer | Gustavo Alvarez | 2016-04-27 17:57:45 +0200 |
commit | de6f00d011835f004af2a76abe2fb07d12288b01 (patch) | |
tree | 5f26e217e2fa9e86f0b6778d8ce77cdae0e66db7 /adchpp-hg.install | |
download | aur-de6f00d011835f004af2a76abe2fb07d12288b01.tar.gz |
Initial commit
Diffstat (limited to 'adchpp-hg.install')
-rw-r--r-- | adchpp-hg.install | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/adchpp-hg.install b/adchpp-hg.install new file mode 100644 index 000000000000..b6b32fd9fb87 --- /dev/null +++ b/adchpp-hg.install @@ -0,0 +1,32 @@ +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() { + systemd-sysusers adchpp.conf + systemd-tmpfiles --create adchpp.conf + + 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 +} |