File: postinst

package info (click to toggle)
postit 0.5-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 160 kB
  • ctags: 218
  • sloc: ansic: 753; sh: 243; makefile: 61
file content (77 lines) | stat: -rw-r--r-- 1,667 bytes parent folder | download
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/sh

###################################################
#
# postinstscript for postit
#
###################################################

SPOOLPATH=/var/spool/news
OUTGOING=${SPOOLPATH}/out.going
BINPATH=/usr/sbin
NEWSSERVER=news.foo.org
CONFIGFILE=/etc/news/postit.conf

ask_outgoing()
{
        echo "Where is the directory for outgoing news?
I assume /var/spool/news/out.going
Press y if this is correct 
"
        read a
        case $a in
                y|Y)OUTGOING=/var/spool/news/out.going;;
                *) ask_directory;
        esac
}

ask_directory()
{
	echo "Insert the directory for outgoing news: "
	read a
	echo "Is \"$a\" correct?"
	read b
	case $b in
		y|Y) OUTGOING=$b;;
		n|N) ask_directory;;
		*) OUTGOING=$b;;
	esac
}

ask_newsserver()
{
	echo "Insert the name of your upstream newsserver"
	echo "e.g. the newsserver of your provider"
	echo
	read a
	echo "Is \"$a\" correct?"
        read b
        case $b in
                y|Y) NEWSSERVER=$a;;
                n|N) ask_newsserver;;
                *) NEWSSERVER=$a;;
        esac
}

ask_outgoing
ask_newsserver

echo "#Configurationfile for postit a program to post news to a server" > $CONFIGFILE
echo "#" >> $CONFIGFILE

echo "SPOOLPATH=/var/spool/news" >> $CONFIGFILE
echo "OUTGOING=$OUTGOING" >> $CONFIGFILE
echo "BINPATH=/usr/lib/news/bin" >> $CONFIGFILE
echo "NEWSSERVER=$NEWSSERVER" >> $CONFIGFILE

chown news.news $CONFIGFILE


echo "Wrote $CONFIGFILE"
echo "Edit /etc/news/postit.conf if you have any changes"
echo 
echo "You should invoke /usr/sbin/sendnews in your ip-up script to post"
echo "your articles immediatly after going online."
echo 
echo "Happy posting"