-
Notifications
You must be signed in to change notification settings - Fork 2
/
Installbbs.sh.in
130 lines (112 loc) · 4.26 KB
/
Installbbs.sh.in
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/bin/sh
BBS_HOME=@BBS_HOME@
BBS_UID=@BBS_UID@
BBS_GID=@BBS_GID@
INSTALL="@INSTALL@"
TARGET=@BBS_HOME@/bin
BBS_SQLDB=@BBS_SQLDB@
BBS_SQLUSER=@BBS_SQLUSER@
BBS_SQLPASSWD=@BBS_SQLPASSWD@
EXEEXT=@EXEEXT@
echo "This script will install the whole BBS to ${BBS_HOME}..."
echo -n "Press <Enter> to continue ..."
read ans
if [ -d ${BBS_HOME} ] ; then
echo -n "Warning: ${BBS_HOME} already exists, overwrite whole bbs [N]?"
read ans
ans=${ans:-N}
case $ans in
[Yy]) echo "Installing new bbs to ${BBS_HOME}" ;;
*) echo "Abort ..." ; exit ;;
esac
else
echo "Making dir ${BBS_HOME}"
mkdir ${BBS_HOME}
chown -R ${BBS_UID} ${BBS_HOME}
chgrp -R ${BBS_GID} ${BBS_HOME}
chmod -R 770 ${BBS_HOME}
fi
echo "Setup bbs directory tree ....."
(cd ${BBS_HOME};mkdir vote tmp reclog bm bin newtrace inndlog scanregister_tmp syslog)
(cd ${BBS_HOME};for i in home mail;do for j in `perl -e "print join(' ',A..Z)"`;do mkdir -p $i/$j;done;done)
( cd bbshome ; tar cf - --exclude=CVS* * ) | ( cd ${BBS_HOME} ; tar xf - )
mv ${BBS_HOME}/BOARDS ${BBS_HOME}/.BOARDS
mv ${BBS_HOME}/badname ${BBS_HOME}/.badname
mv ${BBS_HOME}/bad_email ${BBS_HOME}/.bad_email
touch ${BBS_HOME}/.hushlogin
touch ${BBS_HOME}/.PASSWDS
(cd ${BBS_HOME};for i in BBSHelp bbslists sysop syssecurity notepad newcomers junk vote .tmp .backnumbers;do mkdir -p boards/$i;done)
chown -R ${BBS_UID} ${BBS_HOME}
chgrp -R ${BBS_GID} ${BBS_HOME}
${INSTALL} -m 550 -s -g ${BBS_GID} -o ${BBS_UID} src/bbs${EXEEXT} ${TARGET}
${INSTALL} -m 550 -s -g ${BBS_GID} -o ${BBS_UID} src/bbsd${EXEEXT} ${TARGET}
${INSTALL} -m 550 -s -g ${BBS_GID} -o ${BBS_UID} src/bbs.chatd ${TARGET}/chatd
if [ -f src/pty/ptyexec ]
then
${INSTALL} -m 4550 -s -g root -o root src/pty/ptyexec ${TARGET}
fi
cat > ${BBS_HOME}/etc/sysconf.ini << EOF
#---------------------------------------------------------------
# Here is where you adjust the BBS System Configuration
# Delete ../sysconf.img to make the change after modification
#---------------------------------------------------------------
BBSHOME = "@BBS_HOME@"
BBSID = "@BBS_ID@"
BBSNAME = "@BBS_CNAME@"
BBSDOMAIN = "@BBS_DOMAIN@"
BBSIP = "@BBS_IP@"
KEEP_DELETED_HEADER = 0
#---------------------------------------------------------------
# EMAILFILE - Toggle the E-Mail Registration Feature
# NEWREGFILE - Toggle the 3 days no-post feature for new comers
#---------------------------------------------------------------
EMAILFILE = "etc/mailcheck"
#NEWREGFILE = "etc/newregister"
#---------------------------------------------------------------
# Do not modify anything below unless you know what you are doing...
#---------------------------------------------------------------
PERM_BASIC = 0x00001
PERM_CHAT = 0x00002
PERM_PAGE = 0x00004
PERM_POST = 0x00008
PERM_LOGINOK = 0x00010
PERM_DENYSIG = 0x00020
PERM_CLOAK = 0x00040
PERM_SEECLOAK = 0x00080
PERM_XEMPT = 0x00100
PERM_WELCOME = 0x00200
PERM_BOARDS = 0x00400
PERM_ACCOUNTS = 0x00800
PERM_CHATCLOAK = 0x01000
PERM_OVOTE = 0x02000
PERM_SYSOP = 0x04000
PERM_POSTMASK = 0x08000
PERM_ANNOUNCE = 0x10000
PERM_OBOARDS = 0x20000
PERM_ACBOARD = 0x40000
PERM_NOZAP = 0x80000
PERM_FORCEPAGE = 0x100000
PERM_EXT_IDLE = 0x200000
PERM_SPECIAL1 = 0x400000
PERM_SPECIAL2 = 0x800000
PERM_SPECIAL3 = 0x1000000
PERM_SPECIAL4 = 0x2000000
PERM_SPECIAL5 = 0x4000000
PERM_SPECIAL6 = 0x8000000
PERM_SPECIAL7 = 0x10000000
PERM_SPECIAL8 = 0x20000000
AUTOSET_PERM = PERM_CHAT, PERM_PAGE, PERM_POST, PERM_LOGINOK
PERM_ESYSFILE = PERM_SYSOP,PERM_WELCOME,PERM_ACBOARD,PERM_ACCOUNTS
PERM_ADMINMENU = PERM_ACCOUNTS,PERM_OVOTE,PERM_SYSOP,PERM_OBOARDS,PERM_WELCOME,PERM_ACBOARD
PERM_BLEVELS = PERM_SYSOP,PERM_OBOARDS
PERM_UCLEAN = PERM_SYSOP,PERM_ACCOUNTS
PERM_MAILALL = PERM_SYSOP,PERM_SPECIAL4
#include "etc/menu.ini"
EOF
#bbshome Ŀ¼Ï嵀 uhashgen.dat ÒѾ¿½±´µ½ BBS_HOMEÁË
#cat > ${BBS_HOME}/uhashgen.dat << EOF
#0 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
#EOF
echo "Install is over...."
echo "Check the configuration in ${BBS_HOME}/etc/sysconf.ini"
echo "Then login your BBS and create an account called SYSOP (case-sensitive)"