desktop/cinstall/cinstall.install
2010-07-02 09:42:49 +00:00

122 lines
3.1 KiB
Plaintext

post_install() {
if [ -e "/etc/chakra/updates.conf" ] ; then
. /etc/chakra/updates.conf
if [ "$UPDATE_XDG_ICON_DB" = "yes" ]; then
/usr/bin/chakra-update-icons
fi
else
echo " > WARNING"
echo " The package kde-common seems not to be installed,"
echo " this can possibly break the installation. Just install it"
echo " manually after this installation/update, run the following"
echo " commands and restart KDE afterwards:"
echo " sudo chakra-config-updater"
echo " kbuildsycoca4"
echo " "
fi
echo "Create group bundle"
if [ "Group: `grep bundle /etc/group`" = "Group: " ] ; then
groupadd bundle
else
echo "Group bundle already exists"
fi
echo "Adding all existing users to group bundle"
for i in `cat /etc/passwd | grep /home | cut -d: -f1` ; do
echo " - adding user $i"
usermod -a -G bundle $i
done
echo "Mod sudoers file"
if [ "sudoers: `grep bundle /etc/sudoers`" = "sudoers: " ] ; then
echo "%bundle ALL=NOPASSWD: /bin/mount -o loop -t squashfs *" >> /etc/sudoers
echo "ensure correct sudoers permissions"
chmod -v 0440 /etc/sudoers
else
echo "sudoers file already modded"
fi
echo "update mime-database"
update-mime-database /usr/share/mime &>/dev/null
}
post_upgrade() {
if [ -e "/etc/chakra/updates.conf" ] ; then
. /etc/chakra/updates.conf
if [ "$UPDATE_XDG_ICON_DB" = "yes" ]; then
/usr/bin/chakra-update-icons
fi
else
echo " > WARNING"
echo " The package kde-common seems not to be installed,"
echo " this can possibly break the installation. Just install it"
echo " manually after this installation/update, run the following"
echo " commands and restart KDE afterwards:"
echo " sudo chakra-config-updater"
echo " kbuildsycoca4"
echo " "
fi
echo "Create group bundle"
if [ "Group: `grep bundle /etc/group`" = "Group: " ] ; then
groupadd bundle
else
echo "Group bundle already exists"
fi
echo "Adding all existing users to group bundle"
for i in `cat /etc/passwd | grep /home | cut -d: -f1` ; do
echo " - adding user $i"
usermod -a -G bundle $i
done
echo "Mod sudoers file"
if [ "sudoers: `grep bundle /etc/sudoers`" = "sudoers: " ] ; then
echo "%bundle ALL=NOPASSWD: /bin/mount -o loop -t squashfs *" >> /etc/sudoers
echo "ensure correct sudoers permissions"
chmod -v 0440 /etc/sudoers
else
echo "sudoers file already modded"
fi
echo "update mime-database"
update-mime-database /usr/share/mime &>/dev/null
}
post_remove() {
if [ -e "/etc/chakra/updates.conf" ] ; then
. /etc/chakra/updates.conf
if [ "$UPDATE_XDG_ICON_DB" = "yes" ]; then
/usr/bin/chakra-update-icons
fi
else
echo " > WARNING"
echo " The package kde-common seems not to be installed,"
echo " this can possibly break the installation. Just install it"
echo " manually after this installation/update, run the following"
echo " commands and restart KDE afterwards:"
echo " sudo chakra-config-updater"
echo " kbuildsycoca4"
echo " "
fi
}
op=$1
shift
$op $*