Skip to content

Commit

Permalink
luci-app-statistics: harden sysupgrade_backup
Browse files Browse the repository at this point in the history
Remove sysupgrade_backup from help.  Also have it check parameters.

Signed-off-by: John Kohl <jtk.git@bostonpog.org>
  • Loading branch information
jtkohl authored and hnyman committed Nov 11, 2023
1 parent 465bfe2 commit 55e0f28
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ SYSUPGRADE_BACKUP_TWIN_A="${BACKUP_DIR}/sysupgrade.trustme.txt"
SYSUPGRADE_BACKUP_TWIN_B="${BACKUP_DIR}/sysupgrade.dont.trustme.txt"
EXTRA_COMMANDS="backup sysupgrade_backup"
EXTRA_HELP="\
backup Backup current rrd database if configured to do so\n\
sysupgrade_backup Take a special backup for sysupgrade/configuration saving"

backup Backup current rrd database if configured to do so"
TRACE=0

doing_backups() {
Expand Down Expand Up @@ -150,6 +148,10 @@ copy_backup_for_sysupgrade() {

sysupgrade_backup() {
local filelist="$1"
[ -z "$filelist" -o ! -f "$filelist" ] && {
echo sysupgrade_backup requires an existing filename argument 1>&2
exit 1
}
[ ${TRACE} -gt 0 ] && logger -t ${0##*/} -- luci_statistics sysupgrade_backup CONF_BACKUP_LIST=${CONF_BACKUP_LIST}
doing_backups && {
### CONF_BACKUP_LIST=1 means we are generating the
Expand Down

0 comments on commit 55e0f28

Please sign in to comment.