diff options
Diffstat (limited to 'community/chrony/chrony.install')
-rw-r--r-- | community/chrony/chrony.install | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/community/chrony/chrony.install b/community/chrony/chrony.install index 2badf6471..b5309d226 100644 --- a/community/chrony/chrony.install +++ b/community/chrony/chrony.install @@ -1,14 +1,27 @@ +infodir=usr/share/info +filelist=(chrony.info) + post_install() { getent group chrony &>/dev/null || groupadd -g 183 chrony >/dev/null getent passwd chrony &>/dev/null || useradd -u 183 -g chrony -d /var/lib/chrony -c 'Network Time Protocol' -s /bin/false chrony >/dev/null - true + + [[ -x usr/bin/install-info ]] || return 0 + for file in "${filelist[@]}"; do + install-info "$infodir/$file.gz" "$infodir/dir" 2> /dev/null + done } post_upgrade() { if [[ $(vercmp $2 1.29.1-2) -le 0 ]]; then - post_install + getent group chrony &>/dev/null || groupadd -g 183 chrony >/dev/null + getent passwd chrony &>/dev/null || useradd -u 183 -g chrony -d /var/lib/chrony -c 'Network Time Protocol' -s /bin/false chrony >/dev/null chown -R 183:183 /var/lib/chrony fi + + [[ -x usr/bin/install-info ]] || return 0 + for file in "${filelist[@]}"; do + install-info "$infodir/$file.gz" "$infodir/dir" 2> /dev/null + done } post_remove() { @@ -16,3 +29,10 @@ post_remove() { getent group chrony &>/dev/null && groupdel chrony >/dev/null true } + +pre_remove() { + [[ -x usr/bin/install-info ]] || return 0 + for file in "${filelist[@]}"; do + install-info --delete "$infodir/$file.gz" "$infodir/dir" 2> /dev/null + done +} |