-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmdisk
More file actions
executable file
·40 lines (35 loc) · 1.66 KB
/
mdisk
File metadata and controls
executable file
·40 lines (35 loc) · 1.66 KB
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: Monday, 2024/12/09 - 17:38:37
# Modified By..: @fbnmtz, (fabiano.matoz@gmail.com)
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Version: 0.1.6.205
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Description:
# >
# > https://www.cyberciti.biz/faq/linux-backup-restore-a-partition-table-with-sfdisk-command/
# ############################################################################
# HISTORY:
#
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~
# shellcheck disable=SC1090,SC2154
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~
source "$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