forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathv-change-user-template
More file actions
executable file
·49 lines (35 loc) · 1.33 KB
/
v-change-user-template
File metadata and controls
executable file
·49 lines (35 loc) · 1.33 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
#!/bin/bash
# info: change user default template
# options: USER TEMPLATE
#
# The function changes default user web template.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
user=$1
template=$2
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '2' "$#" 'USER TEMPLATE'
validate_format 'user' 'template'
is_object_valid 'user' 'USER' "$user"
is_object_unsuspended 'user' 'USER' "$user"
is_apache_template_valid
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Changing user shell
update_user_value "$user" '$TEMPLATE' "$template"
# Logging
log_history "changed $user template to $template" '' 'admin'
log_event "$OK" "$EVENT"
exit