#!/bin/bash
#
# ::do_not_edit::
# ::maintainer::
#
CMD=$(basename $0)
CMDVER="1.0"
CMDSTR="$CMD v$CMDVER (2025-10-27)"

echo "
	== $CMDSTR == RESET VEEAM AGENT SETTINGS ==

	WARNING!! THIS WILL DO A **FULL** RESET

	WILL ERASE ALL CURRENT SETTINGS, JOBS HISTORY,
	BACKUPS LOGS (all content of /var/lib/veeam dir)
"

while :
do
	echo -en "Type 'YES' (in uppercase) to confirm: "
	read ans
	case $ans in
	  YES)	break		;;
	  0|[nN]|[nNoO])	exit 1 ;;
	esac
done

echo -en "\n stopping service: veeamservice ... "
/etc/init.d/veeamservice stop
echo "ok"

rm -rf /var/lib/veeam/*

echo -en "\n starting service: veeamservice ... "
/etc/init.d/veeamservice start
echo "ok"

echo -en "
	SETTING ERASED, YOU NEED TO ACCEPT VEEAM LICENSE AGAIN

	Press [Return] to continue: "
read ans

veeam

echo "
	you can use 'veeam_add_default_job' command to restore
	default job
"

exit 0
