File: preinst

package info (click to toggle)
libpam-radius-auth 1.3.16-4.3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 228 kB
  • ctags: 271
  • sloc: ansic: 1,412; makefile: 85; sh: 38
file content (30 lines) | stat: -rw-r--r-- 879 bytes parent folder | download | duplicates (2)
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
30
#!/bin/sh 

action=$1
version=$2

if [ "$action" = upgrade ] && dpkg --compare-versions "$version" lt 1.3.16-1.1 && [ `find /etc/pam_radius_auth.conf -printf %m 2> /dev/null` = '644' ]
then
  # check if debconf is missing
  if ! test -f /usr/share/debconf/confmodule
  then
    cat <<EOF
Older versions of libpam-radius-auth installed the /etc/pam_radius_auth.conf
file with incorrect permissions. Should these permissions be corrected? (I
strongly recommend doing this)
EOF
    echo -n "Make /etc/pam_radius_auth.conf readable only by root? [Yn]: "
    read input
    expr "$input" : '[Nn]' >/dev/null || chmod 600 /etc/pam_radius_auth.conf
  else
    # Source debconf library.
    . /usr/share/debconf/confmodule 
    db_version 2.0
    db_get libpam-radius-auth/fixmodes
    if [ "$RET" != "false" ]; then
      chmod 600 /etc/pam_radius_auth.conf
    fi
  fi
fi

#DEBHELPER#