head     1.1;
branch   1.1.1;
access   ;
symbols  knx-installer-03:1.1.1.1 knoppix:1.1.1;
locks    ; strict;
comment  @# @;


1.1
date     2005.02.18.05.14.41;  author tcheun;  state Exp;
branches 1.1.1.1;
next     ;

1.1.1.1
date     2005.02.18.05.14.41;  author tcheun;  state Exp;
branches ;
next     ;


desc
@@



1.1
log
@Initial revision
@
text
@#!/bin/bash

# Start services for which the config files have changed
# (i.e network, cups, ...)
#
# Part of the knoppix-installer project.
#
# Copyright 2004 by Fabian Franz <knoppix-installer@@fabian-franz.de>
#
# 	Parts taken from saveconfig

export TMP=/tmp/hd-config.$$

clean_exit()
{
  rm -f $TMP
}

trap clean_exit EXIT

# Find changes in (real) files of dir1 ... dir2
findchanged()
{
if [ -d "$1" ]; then
for i in $( cd "$1"; find . -type f | sed 's,^\./,,g' | grep -v ' ' ); do
cmp -s "$1/$i" "$2/$i" || echo "$1/$i"
done
elif [ -e "$1" ]; then
cmp -s "$1" "$2" || echo "$1"
fi
}

# Reset hostname
hostname $(cat /etc/hostname)

findchanged /etc/knoppix/etc /etc > $TMP

SCRIPTS=""
STARTNET=""
STARTPCMCIA=""
STARTCUPS=""

while read i; do
case "$i" in
*/etc/network/interfaces) STARTNET="yes";;
*/etc/pcmcia/*) STARTPCMCIA="yes";;
*/etc/cups*) STARTCUPS="yes";;
esac
done <"$TMP"

if [ -n "$STARTNET" ] 
then 
	echo "[1;33m(Re)starting network services.[0m"
	killall pump 2>/dev/null && sleep 2 && killall -9 pump 2>/dev/null && sleep 2
	SCRIPTS="$SCRIPTS ifupdown networking"
fi

if [ -n "$STARTPCMCIA" ]
then
	echo "[1;33m(Re)starting PCMCIA services.[0m"
	killall cardmgr 2>/dev/null && sleep 4; cardmgr && sleep 4
fi

[ -n "$STARTCUPS" ] && SCRIPTS="$SCRIPTS cupsys"

if [ -n "$SCRIPTS" ]
then
	echo "[1mStarting daemons...[0m"
	for i in $SCRIPTS
	do 
		[ -x /etc/init.d/\$i ] && /etc/init.d/\$i start
	done
fi
@


1.1.1.1
log
@import knoppix knx-installer-0.3
@
text
@@
