-
Notifications
You must be signed in to change notification settings - Fork 0
/
mdisk
executable file
·40 lines (35 loc) · 1.66 KB
/
mdisk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env bash
#
# ############################################################################
# Project: scripts (none)
# File...: mdisk
# Created: Sunday, 2022/02/27 - 15:31:50
# Author.: @fbnmtz, fgm (fabiano.matoz@gmail.com)
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Last Modified: Sunday, 2023/09/03 - 00:32:12
# Modified By..: @fbnmtz, (fabiano.matoz@gmail.com)
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Version: 0.1.6.204
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Description:
# >
# > https://www.cyberciti.biz/faq/linux-backup-restore-a-partition-table-with-sfdisk-command/
# ############################################################################
# HISTORY:
#
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~
# shellcheck disable=SC1090,SC2154
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~
source ~/bin/xSHELL/init
use args mdisk.lib
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~
xarg --id -b,--backup --var f:b,disk+o --desc "backup disk header"
xarg --id -l,--list --var f:l,type+o --desc "list available disks"
xarg --id -r,--restore --var f:r,disk+r --desc "restore an backup"
xrun --xreject-unknow --xrequire-one --xversionrc --xcolors "$@"
# check selected flag
case "$f" in
b) _backup ;;
l) _list $type ;;
r) _resotore ;;
esac