File tree Expand file tree Collapse file tree 1 file changed +81
-0
lines changed
Expand file tree Collapse file tree 1 file changed +81
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # info: list hestia autoupdate settings
3+ # options: [FORMAT]
4+ #
5+ # The function for obtaining autoupdate setings.
6+
7+
8+ # ----------------------------------------------------------#
9+ # Variable&Function #
10+ # ----------------------------------------------------------#
11+
12+ # Argument definition
13+ user=' admin'
14+ format=${1-shell}
15+
16+ # Includes
17+ source $HESTIA /func/main.sh
18+
19+ # JSON list function
20+ json_list () {
21+ echo ' ['
22+ if [ -z " $check_cron " ]; then
23+ echo -e " \t\" Disabled\" ,"
24+ else
25+ echo -e " \t\" Enabled\" "
26+ fi
27+ echo " ]"
28+ }
29+
30+ # SHELL list function
31+ shell_list () {
32+ echo -n " AUTOUPDATE: "
33+ if [ -z " $check_cron " ]; then
34+ echo " Disabled"
35+ else
36+ echo " Enabled"
37+ fi
38+ }
39+
40+ # PLAIN list function
41+ plain_list () {
42+ if [ -z " $check_cron " ]; then
43+ echo " Disabled"
44+ else
45+ echo " Enabled"
46+ fi
47+ }
48+
49+ # CSV list function
50+ csv_list () {
51+ echo " AUTOUPDATE"
52+ if [ -z " $check_cron " ]; then
53+ echo " Disabled"
54+ else
55+ echo " Enabled"
56+ fi
57+ }
58+
59+
60+ # ----------------------------------------------------------#
61+ # Action #
62+ # ----------------------------------------------------------#
63+
64+ # Check cron tab
65+ check_cron=$( grep ' v-update-sys-hestia-all' $USER_DATA /cron.conf)
66+
67+ # Listing data
68+ case $format in
69+ json) json_list ;;
70+ plain) plain_list ;;
71+ csv) csv_list ;;
72+ shell) shell_list;;
73+ esac
74+
75+
76+
77+ # ----------------------------------------------------------#
78+ # Hestia #
79+ # ----------------------------------------------------------#
80+
81+ exit
You can’t perform that action at this time.
0 commit comments