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 31 32 33 34 35 36 37 38 39 40
|
#!/bin/sh -e
if [ "$1" = "configure" ]; then
update-rc.d lessdisks start 19 S . > /dev/null
update-rc.d lessdisks-session start 99 2 . > /dev/null
# needed to ensure same group id number.
if [ -r "/etc/lessdisks/gid" ]; then
lessdisks_gid=$(cat /etc/lessdisks/gid)
fi
if [ -z $(egrep ^lessdisks: /etc/group) ]; then
if [ -z "$lessdisks_gid" ]; then
addgroup lessdisks
else
addgroup --gid $lessdisks_gid lessdisks
fi
else
if [ ! -z "$lessdisks_gid" ]; then
if [ "$lessdisks_gid" = $(egrep ^lessdisks: /etc/group | cut -d : -f 3) ]; then
echo "lessdisks group already exists with the proper gid..."
else
echo "the existing lessdisks group and gid do not match"
echo "the values in /etc/lessdisks/gid"
echo "exiting..."
exit 1
fi
fi
fi
chown -R root.lessdisks /etc/lessdisks
chmod g+rwXs $(find /etc/lessdisks -type d)
chmod g+rw $(find /etc/lessdisks -type f)
touch /etc/kernel-img.conf
if ! egrep "postinst_hook|postrm_hook" /etc/kernel-img.conf; then
echo "postinst_hook = /usr/sbin/update-lessdisks-kernels" >> /etc/kernel-img.conf
echo "postrm_hook = /usr/sbin/update-lessdisks-kernels" >> /etc/kernel-img.conf
fi
fi
#DEBHELPER#
|