POSTIN
/bin/sh
# We have to manage 4 files that are part of other packages
# It's safe to do that because they are managed as config files in other packages
# First, make a backup
for file in /etc/mille-xterm/postsession.d/50_kill_ltspfs.sh \
/etc/mille-xterm/presession.d/10_generate_sshkeys.sh \
/etc/mille-xterm/presession.d/11_getlts.sh \
/etc/mille-xterm/presession.d/20_sendsshkeys.sh \
/etc/mille-xterm/presession.d/50_start_ltspfs.sh \
/etc/mille-xterm/usersession.d/50_mount_ltspfs.sh \
/etc/mille-xterm/usersession.d/70_fix_apps.sh \
/etc/custom/apps/firefox/config/userinstall \
/etc/custom/apps/thunderbird/rootinstall/tbdic \
/etc/custom/share/doc/HTML/index.html \
/etc/X11/gdm/killsessions
do
DN=`dirname $file`
BN=`basename $file`
if [ -f $file ]; then
# Do not overwrite already existing
# backup (in case of upgrade)
if [ ! -f $DN/.$BN.orig ]; then
if [ -f $file.mille_xterm_saved ]; then
mv -f $file.mille_xterm_saved $DN/.$BN.orig
else
mv -f $file $DN/.$BN.orig
fi
fi
fi
# Now, copy mille-xterm config files to replace existing ones
cp -f $DN/.$BN.en_US $file
done
if [ -f /etc/X11/gdm/gdm.conf ] ; then
if [ ! -f /etc/X11/gdm/.gdm.conf.orig ] ; then
if [ -f /etc/X11/gdm/gdm.conf.mille_xterm_saved ] ; then
mv -f /etc/X11/gdm/gdm.conf.mille_xterm_saved /etc/X11/gdm/.gdm.conf.orig
else
cp /etc/X11/gdm/gdm.conf /etc/X11/gdm/.gdm.conf.orig
fi
fi
perl -pi -e "s/Bienvenue sur/Welcome to/g;" /etc/X11/gdm/gdm.conf
fi
if [ -f /var/www/html/state.php ] ; then
perl -pi -e "s/utilisateurs connectés/connected users/g;" /var/www/html/state.php
fi
POSTUN
/bin/sh
#Only if package is uninstalled
if [ "$1" = "0" ]; then
# Replace original files in case of uninstall
for file in /etc/mille-xterm/presession.d/50_kill_ltspfs.sh \
/etc/mille-xterm/presession.d/10_generate_sshkeys.sh \
/etc/mille-xterm/presession.d/11_getlts.sh \
/etc/mille-xterm/presession.d/20_sendsshkeys.sh \
/etc/mille-xterm/presession.d/50_start_ltspfs.sh \
/etc/mille-xterm/usersession.d/50_mount_ltspfs.sh \
/etc/mille-xterm/usersession.d/70_fix_apps.sh \
/etc/custom/apps/firefox/config/userinstall \
/etc/custom/apps/thunderbird/rootinstall/tbdic \
/etc/custom/share/doc/HTML/index.html \
/etc/X11/gdm/killsessions
do
DN=`dirname $file`
BN=`basename $file`
if [ -f $DN/.$BN.orig ]; then
mv -f $DN/.$BN.orig $file
# support older schema
elif [ -f $file.mille_xterm_saved ]; then
mv -f $file.mille_xterm_saved $file
fi
done
if [ -f /etc/X11/gdm/.gdm.conf.orig ] ; then
mv -f /etc/X11/gdm/.gdm.conf.orig /etc/X11/gdm/gdm.conf
elif [ -f /etc/X11/gdm/gdm.conf.mille_xterm_saved ] ; then
mv -f /etc/X11/gdm/gdm.conf.mille_xterm_saved /etc/X11/gdm/gdm.conf
fi
fi