Repository navigation
Expand file tree
/
Copy pathinstall-cgi
More file actions
executable file
·103 lines (79 loc) · 2.27 KB
/
Copy pathinstall-cgi
File metadata and controls
executable file
·103 lines (79 loc) · 2.27 KB
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
#!/bin/sh
#############################################################################
# Steve Rider - stever@area23.org
# Grufti - an interactive, service-oriented bot for IRC
#
# installation script for cgi - copies gb.cgi to appropriate directory
#
#############################################################################
# One lone define.
NOGO="You don't have permission to create a directory there!"
# Whee. This is where the fun stuff happens.
echo ""
echo "========================================================================"
if [ ! -r gb.cgi ]; then
cat <<UNMADE
You must first configure and compile the cgi before you can
install it. Type 'make cgi' to proceed.
UNMADE
exit 1
fi
cat <<WELCOME
Welcome to the Grufti CGI installation script.
This script will install the CGI executable into the specified CGI
directory. If you do not have a dedicated CGI directory, then most
likely you will use the standard public_html directory. If you are
not sure that you are able to even use CGI executables, try it anyway :>
Directory to install the CGI [~/public_html]
WELCOME
read dir
echo ""
if [ $dir"x" = "x" ] ; then
dir="${HOME}/public_html"
elif [ `echo $dir | grep -c '~'` -eq 1 ] ; then
dir=`echo $dir | sed -e 's/\~//;'`
dir=${HOME}${dir}
else
dir=$dir
fi
if [ $dir = `pwd` ]; then
echo $NOGO
exit 1
fi
echo "Installing to: $dir"
if [ ! -d $dir ]; then
mkdir $dir
fi
if [ ! -d $dir ]; then
echo ""
echo "The directory \"$dir\" is invalid."
echo ""
exit 1
fi
if [ ! -r $dir -o ! -w $dir -o ! $dir ]; then
echo $NOGO
exit 1
fi
if [ ! -r README ]; then
echo ""
echo "You must run the install script from the Grufti directory!"
echo ""
exit 1
fi
echo ""
echo "Copying gb.cgi file..."
if [ -r $dir/gb.cgi ]; then
mv -f $dir/gb.cgi $dir/gb.cgi.old
echo "Moving existing gb.cgi to gb.cgi.old..."
fi
cp -f gb.cgi $dir
chmod 755 $dir/gb.cgi
cat <<EOF
Done.
If you haven't read the README file, READ IT NOW!!!
The CGI executable has been installed and given the permission 755. You
should be able to open the URL you specified in webconfig.h to access
the web interface. Use the index.html file in the webstuff directory
to see how to provide a link to your CGI so that you can login.
========================================================================
EOF