]> andersk Git - moira.git/blame - gen/zephyr.sh
Generic acl support.
[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
25 if cmp -s $file ../acl/$file; then
26 mv $file ../acl/$file
27 hup=yes
28 fi
29 else
30 mv $file ../acl/$file
31 hup=yes
32 fi
33done
34
35# HUP zephyrd if needed
36case $hup in
37yes)
38 pid=`ps -ef | awk '/[^]]zephyrd/ { print $2; }'
39 kill -HUP $pid
40 sleep 5
41 ;;
42esac
43
44# cleanup
45rm -rf /etc/athena/zephyr/acl.new
46test -f $TARFILE && rm -f $TARFILE
47test -f $0 && rm -f $0
48
49exit 0
50
This page took 0.294891 seconds and 5 git commands to generate.