-
Notifications
You must be signed in to change notification settings - Fork 2
/
install.sh
115 lines (100 loc) · 1.79 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
110
111
112
113
114
115
#
# Install shell script for minicom and friends.
#
NAME="`whoami`" 2>/dev/null
if [ "$NAME" = "" ]
then
echo "No whoami? Hmmm.. must be Coherent.. Trying \"who am i\""
NAME="`who am i | cut -d' ' -f1`"
fi
if test "$NAME" != root
then
echo "You must be root to install remote."
exit 1
fi
if test $# != 3
then
echo "Usage: install.sh libdir bindir mandir"
exit 1
fi
if test ! -d $1
then
mkdir $1
if [ $? != 0 ]
then
echo "$1: No such directory"
exit 1
fi
fi
if test ! -d $2
then
echo "$2: No such directory"
exit 1
fi
if test ! -d $3
then
echo "$3: No such directory"
exit 1
fi
if test -f remote
then
echo "Installing remote in $2"
cp remote $2/remote
chmod 755 $2/remote
chown remote $2/remote
# chgrp remote $2/remote
fi
if test -f down
then
echo "Installing down in $2"
cp down $2/down
chmod 755 $2/down
chown remote $2/down
# chgrp remote $2/down
fi
for i in runscript xremote
do
if test -f $i
then
echo "Installing $i in $2"
cp $i $2/$i
chmod 755 $2/$i
chown remote $2/$i
# chgrp remote $2/$i
fi
done
if test -f keyserv
then
echo "Installing keyserv in $1"
cp keyserv $1/keyserv
chmod 755 $1/keyserv
chown remote $1/keyserv
# chgrp remote $1/keyserv
fi
echo "Installing manpages in $3"
for i in remote.1 runscript.1
do
cp ../man/$i $3
chmod 644 $3/$i
chown remote $3/$i
# chgrp remote $3/$i
done
if [ ! -f $1/remote.users ]
then
echo "Installing sample config file remote.users in $1"
cp remote.users $1
chown remote $1/remote.users
# chgrp remote $1/remote.users
chmod 644 $1/remote.users
fi
if [ ! -f $1/remoterc.dfl ]
then
echo "Installing sample config file remoterc.dfl in $1"
cp remoterc.dfl $1
chown remote $1/remoterc.dfl
# chgrp remote $1/remoterc.dfl
chmod 644 $1/remoterc.dfl
fi
echo "Making remote setuid to username remote"
chmod 4755 $2/remote
exit 0