From ebce5b9ed2f4600786241894a4cf6e3c938c44b7 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Mon, 20 May 2019 16:53:50 -0600 Subject: [PATCH] func: backupFiles --- f2b-config.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/f2b-config.sh b/f2b-config.sh index c168a69..d020ebf 100644 --- a/f2b-config.sh +++ b/f2b-config.sh @@ -21,6 +21,15 @@ note="\e[95m" ### functions +function backupFiles { + # check if file exists + if [ -f "${F2B-DIR}/$1" ]; then + cp "${F2B-DIR}/$1" "${F2B-DIR}/$1.original" + return "$?" + fi + return 0 +} + ### end of functions