forked from bmybbs/bmybbs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Install.sh.in
122 lines (106 loc) · 4.11 KB
/
Install.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
#! /bin/sh
BBS_HOME=@BBS_HOME@
BBSUID=@BBS_UID@
BBSGRP=@BBS_GID@
INSTALL="@INSTALL@"
TARGET=@BBS_HOME@/bin
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 ${BBSUID} ${BBS_HOME}
chgrp -R ${BBSGRP} ${BBS_HOME}
chmod -R 770 ${BBS_HOME}
fi
echo "Setup bbs directory tree ....."
(cd ${BBS_HOME};mkdir vote tmp reclog bm bin traced newtrace)
(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 ${BBS_HOME};for i in bbslists sysop syssecurity notepad newcomers junk vote .tmp .backnumbers;do mkdir -p boards/$i;done)
(cd ${BBS_HOME};for i in sysop bbslists vote newcomers;do mkdir -p 0Announce/groups/GROUP_0/$i;done)
(cd ${BBS_HOME};mkdir -p 0Announce/groups/GROUP_7/notepad)
( cd bbshome ; tar cf - * ) | ( 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
chown -R ${BBSUID} ${BBS_HOME}
chgrp -R ${BBSGRP} ${BBS_HOME}
${INSTALL} -m 550 -s -g ${BBSGRP} -o ${BBSUID} src/bbs ${TARGET}
${INSTALL} -m 550 -s -g ${BBSGRP} -o ${BBSUID} src/bbsd ${TARGET}
${INSTALL} -m 550 -s -g ${BBSGRP} -o ${BBSUID} src/bbs.chatd ${TARGET}/chatd
${INSTALL} -m 550 -s -g ${BBSGRP} -o ${BBSUID} src/thread ${TARGET}
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_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
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)"