-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinstall.sh
More file actions
71 lines (52 loc) · 1.7 KB
/
Copy pathinstall.sh
File metadata and controls
71 lines (52 loc) · 1.7 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
#!/bin/sh
VERSION_NEW="v1.1.1"
# Getting the path to run the script
ABSOLUTE_FILENAME=`readlink -f "$0"`
HOME_FOLDER=`dirname "$ABSOLUTE_FILENAME"` && HOME_FOLDER_SED=$(echo $HOME_FOLDER | sed 's/\//\\\//g')
LISTS=$HOME_FOLDER/lists
SCRIPTS=$HOME_FOLDER/scripts && SCRIPTS_SED=$(echo $SCRIPTS | sed 's/\//\\\//g')
SYSTEM_FOLDER=`echo $HOME_FOLDER | awk -F/opt '{print $1}'`
SYSTEM_FOLDER=$SYSTEM_FOLDER/opt && SYSTEM_FOLDER_SED=$(echo $SYSTEM_FOLDER | sed 's/\//\\\//g')
echo -e "HomeFolder is $HOME_FOLDER \nSystemFolder is $SYSTEM_FOLDER"
source $HOME_FOLDER/Install/install_func.sh
while true; do
echo -e "\nBegin install? y/n"
read yn
case $yn in
[Yy]* )
if [ $(echo $ABSOLUTE_FILENAME | grep -c Bird4Static) -eq 1 ]; then Bird4Static=1; else Bird4Static=0; fi
# Select dns
select_dns_mode
# Installing packages
install_packages_func
# Create start folders
create_folder_func
# Stop service if exist
stop_func
# Try get old config
if [ "$1" == "-u" ]; then UPDATE=1 && get_old_config_func; fi
# try get bird4static config
if [ "$Bird4Static" == "1" ]; then try_get_bird4static_config_func; fi
# Select number vpn
select_number_vpn_func
# Filling script folders and custom sheets
fill_folder_and_sed_func
# Copying the ipset4static configuration file
copy_ipset4static_config_func
# Reading vpn and provider interfaces, replacing in scripts and bird configuration
show_interfaces_func
config_isp_func
config_vpn1_func
if [ "$VCONF" == "2" ]; then config_vpn2_func; fi
# Organizing scripts into folders
ln_scripts_func
# Change dns settings to ipset file
change_dns_config
# Starting Services
run_func
exit 0
;;
[Nn]* ) exit 0;;
* ) echo "Please answer yes or no.";;
esac
done