desktop/cinstall/cinstall.install

122 lines
3.1 KiB
Plaintext
Raw Normal View History

2010-06-22 21:15:23 +08:00
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
2010-06-26 03:46:11 +08:00
echo "%bundle ALL=NOPASSWD: /bin/mount -o loop -t squashfs *" >> /etc/sudoers
2010-06-22 21:15:23 +08:00
echo "ensure correct sudoers permissions"
chmod -v 0440 /etc/sudoers
else
echo "sudoers file already modded"
fi
2010-06-26 06:33:12 +08:00
echo "update mime-database"
2010-07-02 17:42:49 +08:00
update-mime-database /usr/share/mime &>/dev/null
2010-06-22 21:15:23 +08:00
}
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
2010-06-26 05:43:57 +08:00
echo "%bundle ALL=NOPASSWD: /bin/mount -o loop -t squashfs *" >> /etc/sudoers
2010-06-22 21:15:23 +08:00
echo "ensure correct sudoers permissions"
chmod -v 0440 /etc/sudoers
else
echo "sudoers file already modded"
fi
2010-06-26 06:33:12 +08:00
echo "update mime-database"
2010-07-02 17:42:49 +08:00
update-mime-database /usr/share/mime &>/dev/null
2010-06-22 21:15:23 +08:00
}
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
2010-06-25 03:11:26 +08:00
$op $*