dotfiles/.local/bin/scripts/part

13 lines
247 B
Plaintext
Raw Normal View History

2021-12-02 17:15:26 +00:00
#!/bin/sh
2022-11-19 18:57:52 +00:00
# Manage partitions
# TODO completion
2021-12-02 17:15:26 +00:00
case "$1" in
([a-z]) part=/dev/sd$1;;
2022-03-15 15:56:22 +00:00
("") part= ;; # TODO unmount and run on current
(/*) part=$1;;
(*) part=/dev/$1;;
2021-12-02 17:15:26 +00:00
esac
2022-11-19 18:57:52 +00:00
test "$#" -eq 0 || shift
cfdisk $part "$@" ||
sudo cfdisk $part "$@"