-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
executable file
·59 lines (43 loc) · 1.7 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
#!/bin/bash
#########################################################################
# Title: OpenVPN iocage jail under FreeNAS #
# Author: Bibi40k #
# Repository: https://github.com/Bibi40k/OpenVPN-on-FreeNAS-in-iocage #
#########################################################################
# First of all, we clear the screen
clear
# Getting installer dir ( /root/OpenVPN-on-FreeNAS-in-iocage )
CWD="`pwd`"
SCRIPT="`which $0`"
RELDIR="`dirname $SCRIPT`"
cd "$RELDIR"
DIR="`pwd`"
cd "$CWD"
source $DIR/scripts/colors.sh # messages' colors
source $DIR/scripts/check_user.sh # checks minimum requirements
CheckUser # user must be root
# Update script to the latest version
echo
echo -e "${INFO} Checking for script updates..."
echo
cd ${DIR}
git pull
# Import scripts from /scripts dir
source $DIR/scripts/autodiscover.sh # autodiscovers few vars we need later
source $DIR/scripts/dirs.sh # create all dir structure
source $DIR/scripts/files.sh # create/copy all files
source $FVARS # custom vars in '${DCONFIG}/jail-install.cfg'
source $DIR/scripts/update_config.sh # update 'openvpn-install.cfg' file so user will keep customizations
source $DIR/scripts/check_os.sh # checks minimum requirements
# Loading fixes for specific versions; updated as they appear
echo -e "${INFO} Getting fixes for ${COLOR_BLUE}FreeNAS ${OS_VERSION}${COLOR_N}... "
source $DIR/scripts/${OS_VERSION}/fixes.sh
CheckOS # check if script is compatible with this FreeNAS version
source $DIR/scripts/defaults.sh # default vars & constants
source $DIR/scripts/functions.sh # functions
if [[ $# == "1" ]]; then
HandleArgs "$1"
exit 0
else
StartUpScreen
fi