forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathv-change-sys-demo-mode
More file actions
executable file
·55 lines (42 loc) · 1.66 KB
/
v-change-sys-demo-mode
File metadata and controls
executable file
·55 lines (42 loc) · 1.66 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
#!/bin/bash
# info: enable or disable demo mode
# options: ACTIVE
# This function will set the demo mode variable,
# which will prevent usage of certain v-scripts in the backend
# and prevent modification of objects in the control panel.
#
# It will also disable virtual hosts for Apache and NGINX
# for domains which have been created.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
active=$1
# Includes
source $HESTIA/func/main.sh
source $HESTIA/conf/hestia.conf
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '1' "$#" 'ACTIVE'
is_format_valid 'active'
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
if [ "$active" = "yes" ]; then
#TO-DO: Instructions for disabling vhosts
$BIN/v-change-sys-config-value 'DEMO_MODE' "$active"
elif [ "$active" = "no" ]; then
#TODO: Instructions for enabling vhosts
$BIN/v-change-sys-config-value 'DEMO_MODE' "$active"
fi
#----------------------------------------------------------#
# Hestia #
#----------------------------------------------------------#
# Restarting web server
$BIN/v-restart-web $restart
check_result $? "restart" >/dev/null 2>&1
$BIN/v-restart-proxy $restart
check_result $? "restart" >/dev/null 2>&1
# Logging
log_event "$OK" "$ARGUMENTS"
exit