-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathinstall.sh
executable file
·109 lines (100 loc) · 2.1 KB
/
install.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
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
#!/bin/sh
if [ `whoami` != "root" ];
then
echo "Please run this script as root!"
exit
fi
echo "Please enter the install path (e.g. /home/bbs)"
read INSTALL_PATH
echo "Do you have the bbs and bbsadmin user? (type YES or NO)"
ADD_USERS=0
while [ true ];
do
read INPUT
case $INPUT in
"YES")
break
;;
"NO")
ADD_USERS=1
break
;;
*)
echo "Type YES or NO"
;;
esac
done
if [ $ADD_USERS -eq 1 ];
then
echo "The system will now in 5 seconds create the bbs user,"
echo "bbsadmin, zipcheck users (and groups). Press Ctrl-C to abort"
sleep 5
groupadd zipcheck
useradd -g zipcheck -s /bin/false zipcheck
groupadd bbs
useradd -d $INSTALL_PATH -m -G zipcheck -g bbs bbsadmin
echo "Please type the password for your bbs administrator user"
passwd bbsadmin
useradd -d $INSTALL_PATH -G zipcheck -g bbs -s /bin/false bbs
echo "Please type the password for your bbs user (used for ssh login to"
echo "the BBS)"
passwd bbs
chown bbsadmin:bbs $INSTALL_PATH
chmod 750 $INSTALL_PATH
fi
echo "Should we install the data files? (only for new installations)"
echo "Type YES or NO"
INSTALL_DATA=0
while [ true ];
do
read INPUT
case $INPUT in
"YES")
INSTALL_DATA=1
break
;;
"NO")
break
;;
*)
echo "Type YES or NO"
;;
esac
done
if [ $INSTALL_DATA -eq 1 ];
then
cd INSTALL
sh install_me.sh $INSTALL_PATH
cd ..
fi
cd DOCS
if [ ! -d $INSTALL_PATH/docs ]
then
mkdir $INSTALL_PATH/docs
fi
cp -R * $INSTALL_PATH/docs
cd ..
cd SRC
sh make.sh build
INSTALL_PATH=$INSTALL_PATH sh make.sh install
OLD_PWD=`pwd`
cd $INSTALL_PATH
. scripts/ddenv.sh
ddcfg configs/daydream.cfg
cd $OLD_PWD
sh secure.sh $INSTALL_PATH
if [ $INSTALL_DATA -eq 1 ];
then
echo "Add the following lines to your inetd.conf"
echo ""
cat $INSTALL_PATH/for_inetd.conf
rm $INSTALL_PATH/for_inetd.conf
echo ""
echo "Or check out xinetd.howto in docs directory for xinetd support"
echo ""
fi
if [ $ADD_USERS -eq 1 ];
then
usermod -s $INSTALL_PATH/scripts/ddlogin.sh bbs
fi
echo "Setup complete, restart inetd and telnet to localhost"