source: trunk/cereal/debian/cereal.preinst @ 1038

Last change on this file since 1038 was 1038, checked in by jrollins, 10 years ago

Squashed commit of the following:

commit 1ca4607eacff76712b68833fac1d9d0cca0fb423
Author: Jameson Graef Rollins <jrollins@…>
Date: Thu Apr 24 18:00:15 2008 -0400

cereal: move to new method of registration on creation

commit bdbecb3ae1371da447c8d957ec2c08afc0da9fb7
Author: Jameson Graef Rollins <jrollins@…>
Date: Thu Apr 24 13:52:23 2008 -0400

cereal: fixing a lot of bashisms. moved some functions to common, so
that they don't have to be exported.

  • Property svn:executable set to *
File size: 903 bytes
Line 
1#!/bin/sh -e
2
3# preinst script for cereal
4
5# Author: Jamie Rollins <jrollins@fifthhorseman.net> and
6#         Daniel Kahn Gillmor <dkg-debian.org@fifthhorseman.net>
7# (c) 2007
8
9# make new sessions dir and move all old sessions into it
10if [ -d /var/lib/cereal/ -a ! -d /var/lib/cereal/sessions ] ; then
11    echo "moving sessions to new session directory /var/lib/cereal/sessions/..."
12
13    # find all active sessions
14    SESSIONS=$(cereal list | cut -d ' ' -f 2)
15
16    mkdir -p /var/lib/cereal/sessions
17
18    for SESSION in $SESSIONS ; do
19        echo "moving '$SESSION'..."
20        mv /var/lib/cereal/"$SESSION" /var/lib/cereal/sessions/"$SESSION"
21        if [ -L "/var/service/cereal.$SESSION" ] ; then
22            ln -sfn "/var/lib/cereal/sessions/$SESSION" "/var/service/cereal.$SESSION"
23        fi
24    done
25fi
26
27# dh_installdeb will replace this with shell code automatically
28# generated by other debhelper scripts.
29
30#DEBHELPER#
31
32exit 0
Note: See TracBrowser for help on using the repository browser.