forked from darkwhispering/Newvhost
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvhinstaller
More file actions
53 lines (43 loc) · 1020 Bytes
/
Copy pathvhinstaller
File metadata and controls
53 lines (43 loc) · 1020 Bytes
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
#!/bin/bash
#
# title : installer
# description : installs 'newvhost'
# usage : No parameters. Just invoke script-name.
#==============================================================================
# Check so root is running the script
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# Set up variables and strings
tLOCAL="/usr/local/newvhost"
tBIN="/usr/bin/newvhost"
tINSTALL=$(pwd)
# Get proper paths to binaries used
tCHOWN=$(which chown)
tMKDIR=$(which mkdir)
tCHMOD=$(which chmod)
tCP=$(which cp)
tLN=$(which ln)
#-----------------------------------------------
# Functions
#-----------------------------------------------
#
# Install newvhost script
#
function installer() {
$tMKDIR $tLOCAL
$tCP $tINSTALL/* $tLOCAL/
$tCHOWN -R root:root $tLOCAL
$tCHMOD -R 644 $tLOCAL
$tCHMOD 755 $tLOCAL/newvhost
$tCHMOD 755 $tLOCAL/installer
$tLN -s $tLOCAL/newvhost $tBIN
echo
echo "Installation complete!"
echo
}
#
# Main
#
installer