]> andersk Git - moira.git/blame - gen/zephyr.sh
syslog instead of spewing to stdout.
[moira.git] / gen / zephyr.sh
CommitLineData
883e2e2b 1#!/bin/sh
2# $Id$
3
4# The following exit codes are defined and MUST BE CONSISTENT with the
5# error codes the library uses:
6MR_MISSINGFILE=47836473
7MR_MKCRED=47836474
8MR_TARERR=47836476
9
10hup=no
11PATH=/bin
12TARFILE=/var/tmp/zephyr.out
13
14# Alert if the tar file does not exist
15test -r $TARFILE || exit $MR_MISSINGFILE
16
17# Make a temporary directory to unpack the tar file into
18mkdir /etc/athena/zephyr/acl.new
19cd /etc/athena/zephyr/acl.new || exit $MR_MKCRED
20tar xf $TARFILE || exit $MR_TARERR
21
22# Copy over each file which is new or has changed
23for file in *; do
24 if [ -f ../acl/$file ]; then
0bad3a3a 25 cmp -s $file ../acl/$file
26 if [ $? != 0 ]; then
883e2e2b 27 mv $file ../acl/$file
28 hup=yes
29 fi
30 else
31 mv $file ../acl/$file
32 hup=yes
33 fi
34done
35
36# HUP zephyrd if needed
37case $hup in
38yes)
081ad334 39 pid=`ps -ef | awk '/[^\]]zephyrd/ { print $2; }'`
883e2e2b 40 kill -HUP $pid
41 sleep 5
42 ;;
43esac
44
45# cleanup
46rm -rf /etc/athena/zephyr/acl.new
47test -f $TARFILE && rm -f $TARFILE
48test -f $0 && rm -f $0
49
50exit 0
51
This page took 0.052056 seconds and 5 git commands to generate.