mirror of
https://github.com/serghey-rodin/vesta.git
synced 2024-12-03 19:00:24 -08:00
ff7d48bf66
Fix wrong documentation
82 lines
1.6 KiB
Bash
Executable File
82 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
|
# info: list vesta autoupdate settings
|
|
# options: [FORMAT]
|
|
#
|
|
# The function for obtaining autoupdate setings.
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Variable&Function #
|
|
#----------------------------------------------------------#
|
|
|
|
# Argument definition
|
|
user='admin'
|
|
format=${1-shell}
|
|
|
|
# Includes
|
|
source $VESTA/func/main.sh
|
|
|
|
# JSON list function
|
|
json_list() {
|
|
echo '['
|
|
if [ -z "$check_cron" ]; then
|
|
echo -e "\t\"Disabled\","
|
|
else
|
|
echo -e "\t\"Enabled\""
|
|
fi
|
|
echo "]"
|
|
}
|
|
|
|
# SHELL list function
|
|
shell_list() {
|
|
echo -n "AUTOUPDATE: "
|
|
if [ -z "$check_cron" ]; then
|
|
echo "Disabled"
|
|
else
|
|
echo "Enabled"
|
|
fi
|
|
}
|
|
|
|
# PLAIN list function
|
|
plain_list() {
|
|
if [ -z "$check_cron" ]; then
|
|
echo "Disabled"
|
|
else
|
|
echo "Enabled"
|
|
fi
|
|
}
|
|
|
|
# CSV list function
|
|
csv_list() {
|
|
echo "AUTOUPDATE"
|
|
if [ -z "$check_cron" ]; then
|
|
echo "Disabled"
|
|
else
|
|
echo "Enabled"
|
|
fi
|
|
}
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Action #
|
|
#----------------------------------------------------------#
|
|
|
|
# Check cron tab
|
|
check_cron=$(grep 'v-update-sys-vesta-all' $USER_DATA/cron.conf)
|
|
|
|
# Listing data
|
|
case $format in
|
|
json) json_list ;;
|
|
plain) plain_list ;;
|
|
csv) csv_list ;;
|
|
shell) shell_list;;
|
|
esac
|
|
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Vesta #
|
|
#----------------------------------------------------------#
|
|
|
|
exit
|