preinst is in cereal 0.24-1.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
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 | #!/bin/sh -e
# preinst script for cereal
# Author: Jameson Graef Rollins <jrollins@finestructure.net> and
# Daniel Kahn Gillmor <dkg@fifthhorseman.net>
# (c) 2007
# make new sessions dir and move all old sessions into it
if [ -d /var/lib/cereal/ -a ! -d /var/lib/cereal/sessions ] ; then
echo "moving sessions to new session directory /var/lib/cereal/sessions/..."
# find all active sessions
SESSIONS=$(cereal list | cut -d ' ' -f 2)
mkdir -p /var/lib/cereal/sessions
for SESSION in $SESSIONS ; do
echo "moving '$SESSION'..."
mv /var/lib/cereal/"$SESSION" /var/lib/cereal/sessions/"$SESSION"
if [ -L "/var/service/cereal.$SESSION" ] ; then
ln -sfn "/var/lib/cereal/sessions/$SESSION" "/var/service/cereal.$SESSION"
fi
done
fi
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
exit 0
|