-
Notifications
You must be signed in to change notification settings - Fork 0
/
inn2newsd.sh
executable file
·57 lines (47 loc) · 1006 Bytes
/
inn2newsd.sh
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
#
# Simple script to convert an INND spool directory into a Newsd spool
# directory.
#
# Usage:
#
# inn2newsd.sh inn-spooldir newsd-spooldir
#
if test $# != 2; then
echo Usage: $0 inn-spooldir newsd-spooldir
exit 1
fi
if test ! -d "$1"; then
echo $0: INND directory $1 does not exist!
exit 1
fi
if test ! -d "$1/articles"; then
echo $0: INND directory $1 does not contain an articles subdirectory!
exit 1
fi
if test ! -d "$2"; then
echo $0: Newsd directory $2 does not exist!
exit 1
fi
inndspool="$1/articles"
newsdspool="$2"
cd "$inndspool"
if test "$inndspool" != "$newsdspool"; then
echo Copying INND articles to Newsd...
cp -r * "$newsdspool"
chown -R news:news "$newsdspool"
chmod -R ugo+r,u+w,go-w "$newsdspool"
echo Copy complete!
fi
cd "$newsdspool"
echo Creating Newsd groups...
for group in `find . -type d -print`; do
case "$group" in
*/announce | */commit | */cvs)
echo postok 0 >$group/.config
;;
*)
echo postok 1 >$group/.config
;;
esac
done