mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
read ignore path from /etc/fstab
* ignore /snap only if snap command exists (for ubuntu)
This commit is contained in:
parent
8f36b8feb8
commit
30489efd3b
@ -26,7 +26,8 @@ asktype() { \
|
||||
esac
|
||||
}
|
||||
|
||||
drives=$(lsblk -nrpo "name,type,size,mountpoint" | awk '$4!~/\/boot|\/home$|SWAP/&&length($4)>1{printf "%s (%s)\n",$4,$3}')
|
||||
ignores=$(echo $(grep UUID /etc/fstab | awk '$3 !~ /swap|this/ { print $2 }') | sed 's/ /$|^/g' | sed 's/\//\\\//g')
|
||||
drives=$(lsblk -nrpo "name,type,size,mountpoint" | awk '$4!~/^'$ignores'$'$(which snap >/dev/null 2>&1 && echo "|\\/snap")'|SWAP/&&length($4)>1{printf "%s (%s)\n",$4,$3}')
|
||||
|
||||
if ! grep simple-mtpfs /etc/mtab; then
|
||||
[ -z "$drives" ] && echo "No drives to unmount." && exit
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user