aboutsummaryrefslogtreecommitdiffstats
path: root/SOURCE/main.sh
diff options
context:
space:
mode:
authordanix <danix@danix.xyz>2023-04-07 09:19:21 +0200
committerdanix <danix@danix.xyz>2023-04-07 09:19:21 +0200
commit3951cc3d829d51e8cd3de200612477f0548520c2 (patch)
treed4ad65bd99e3dcd56488b32551f27ea1b7382800 /SOURCE/main.sh
parent9eb02251c45d2b0d312b2c40f65f2f926bfb9a34 (diff)
downloadbash-notes-3951cc3d829d51e8cd3de200612477f0548520c2.tar.gz
bash-notes-3951cc3d829d51e8cd3de200612477f0548520c2.zip
implemented backup and restore routines
Diffstat (limited to 'SOURCE/main.sh')
-rw-r--r--SOURCE/main.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/SOURCE/main.sh b/SOURCE/main.sh
index 612200d..476243b 100644
--- a/SOURCE/main.sh
+++ b/SOURCE/main.sh
@@ -1,5 +1,5 @@
# shellcheck disable=SC2006
-GOPT=$(getopt -o hvpla::e::d::s:: --long help,version,list,plain,userconf,backup::,add::,edit::,delete::,show:: -n 'bash-notes' -- "$@")
+GOPT=$(getopt -o hvplr::a::e::d::s:: --long help,version,list,plain,userconf,restore::,backup::,add::,edit::,delete::,show:: -n 'bash-notes' -- "$@")
# shellcheck disable=SC2181
if [ $? != 0 ] ; then helptext >&2 ; exit 1 ; fi
@@ -78,6 +78,19 @@ while true; do
shownote "$NOTE"
exit
;;
+ -r | --restore )
+ case "$2" in
+ '' )
+ read -r -p "Backup Dir: " RDIR
+ ;;
+ * )
+ RDIR=$2
+ ;;
+ esac
+ shift 2
+ backup_restore $RDIR
+ exit
+ ;;
--userconf )
export_config
# shellcheck disable=SC2317