cd17e0e13c
* Fix language selection bug. * Add DEBUG_SUPPORT variable to build debug tools.
39 lines
599 B
Bash
Executable file
39 lines
599 B
Bash
Executable file
#!/bin/bash
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
# Copyright (C) 2023-present Fewtarius
|
|
|
|
. /etc/profile
|
|
|
|
CFG_PATH="/storage/.config/system/configs"
|
|
|
|
backup() {
|
|
TYPE=$(grep a ${CFG_PATH}/system.cfg 2>&1)
|
|
if [[ ! "${TYPE}" =~ binary ]]
|
|
then
|
|
cp ${CFG_PATH}/system.cfg ${CFG_PATH}/system.cfg.backup
|
|
fi
|
|
}
|
|
|
|
restore() {
|
|
cp ${CFG_PATH}/system.cfg.backup ${CFG_PATH}/system.cfg
|
|
}
|
|
|
|
verify() {
|
|
TYPE=$(grep a ${CFG_PATH}/system.cfg 2>&1)
|
|
if [[ "${TYPE}" =~ binary ]]
|
|
then
|
|
restore
|
|
fi
|
|
}
|
|
|
|
case ${1} in
|
|
verify)
|
|
verify
|
|
;;
|
|
backup)
|
|
backup
|
|
;;
|
|
restore)
|
|
restore
|
|
;;
|
|
esac
|