#!/bin/bash

###########################################################################
#
# MODULE:       GUI
# AUTHOR(S):    CacheGuard Development Team
# COPYRIGHT:    (C) 2009-2025 by CacheGuard Technologies Ltd (UK)
# COPYRIGHT:    (C) 2026-2026 by CacheGuard Technologies SAS (FR)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###########################################################################

set-log-save()
{
    case "${VALUES[0]}" in
	web|rweb|guard|waf|antivirus|firewall|vpnipsec|system)
	    type=${VALUES[0]}
	    ;;
	*)
	    return 1
	    ;;
    esac

    if test -z "${VALUES[4]}" ; then
	gen-gui-error 6
	return 0
    fi

    log-command "log" "save ${type} ${VALUES[1]} ${VALUES[2]:1} ${VALUES[3]} ${VALUES[4]}"
    execute-command "log save ${type} ${VALUES[1]} ${VALUES[2]:1} ${VALUES[3]} ${VALUES[4]}"
}

set-log-save
