File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed
Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # info: rebuild system user
3+ # options: USER [RESTART]
4+ #
5+ # The function rebuilds system user accounts.
6+
7+ # ----------------------------------------------------------#
8+ # Variable&Function #
9+ # ----------------------------------------------------------#
10+
11+ # Argument definition
12+ restart=$1
13+
14+ # Includes
15+ source $HESTIA /func/main.sh
16+ source $HESTIA /func/rebuild.sh
17+ source $HESTIA /conf/hestia.conf
18+
19+ # Export sbin
20+ export PATH=$PATH :/usr/sbin
21+
22+
23+ # ----------------------------------------------------------#
24+ # Verifications #
25+ # ----------------------------------------------------------#
26+
27+ check_args ' 1' " $# " ' USER [RESTART]'
28+ is_format_valid ' user'
29+ is_object_valid ' user' ' USER' " $user "
30+ is_object_unsuspended ' user' ' USER' " $user "
31+
32+
33+ # ----------------------------------------------------------#
34+ # Action #
35+ # ----------------------------------------------------------#
36+
37+ # Rebuild loop
38+ for user in $( $BIN /v-list-users plain | cut -f 1) ; do
39+ $BIN /v-rebuild-user $user
40+ done
41+
42+
43+ # ----------------------------------------------------------#
44+ # Hestia #
45+ # ----------------------------------------------------------#
46+
47+ # Logging
48+ log_event " $OK " " $ARGUMENTS "
49+
50+ exit
You can’t perform that action at this time.
0 commit comments