-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall
executable file
·112 lines (90 loc) · 2.76 KB
/
install
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
#!/bin/bash
# QDNet installation script
################################################################################
# BEGIN DEPENDENCY CHECK #
################################################################################
missing_dependencies=0
dhcp_client=0
echo Checking for dependencies...
# list all dependencies (NOT INCLUDING DHCP CLIENTS)
for dep in bc zenity notify-send
do
type $dep &> /dev/null
if [ $? -eq 1 ]
then
echo $dep is missing, please install it.
missing_dependencies=1
fi
done
if [ $missing_dependencies -eq 1 ]
then
exit 1
fi
# list all dhcp clients that you want to search for.
for client in dhclient dhcpcd
do
type $client &> /dev/null
if [ $? -eq 0 ]
then
dhcp_client=1;
break;
fi
done
if [ $dhcp_client -ne 1 ]
then
echo No DHCP client found. Please install one.
exit 1
fi
################################################################################
# END DEPENDENCY CHECK #
################################################################################
################################################################################
# START INSTALLATION #
################################################################################
echo Installing qdnet...
echo Creating qdnet group
groupadd qdnet &> /dev/null
echo Creating configuration files
mkdir -p /etc/qdnet
cp -r ./qdnet_etc/* /etc/qdnet/
chown root:qdnet -R /etc/qdnet/
chmod 644 -R /etc/qdnet/
chmod 600 /etc/qdnet/qdnet.pwd
touch /tmp/qdnet.tmp
cat /etc/qdnet/qdnet.conf | sed -e "s/^DHCP_CLIENT=\([[:alpha:]]*\)/DHCP_CLIENT=$client/" >> /tmp/qdnet.tmp
mv /tmp/qdnet.tmp /etc/qdnet/qdnet.conf
chown root:qdnet /etc/qdnet/qdnet.conf
chmod 644 /etc/qdnet/qdnet.conf
echo Copying icon set
mkdir -p /usr/share/qdnet
cp -pr ./share/qdnet/* /usr/share/qdnet/
echo Installing binaries
mkdir -p /tmp/qdnet
cp -r ./bin/* /tmp/qdnet/
chown root:qdnet -R /tmp/qdnet/*
chmod 500 /tmp/qdnet/*
chmod 550 /tmp/qdnet/qdteller
chmod 550 /tmp/qdnet/qdnetc
cp -pr /tmp/qdnet/* /usr/bin/
rm -r /tmp/qdnet
# note to self: may need gzip man pages instead of bz2
echo Installing man pages
cp -pr ./man/*.bz2 /usr/share/man/man8/
echo Creating devices
mkfifo /dev/qdnet &> /dev/null
chown root:qdnet /dev/qdnet
chmod 420 /dev/qdnet
cat <<HEREDOC
___ ____ _ _ _
/ _ \| _ \| \ | | ___| |_
| | | | | | | \| |/ _ \ __|
| |_| | |_| | |\ | __/ |_
\__\_\____/|_| \_|\___|\__|
by Panther Linux User Group
Installation completed!
======================
If you would like a regular user to be able to use qdnet
just add that user to the qdnet group:
gpasswd -a [user] qdnet // must use root privileges
Have fun!
HEREDOC