You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
cdist-mirror/cdist/conf/explorer/disks

27 lines
650 B

#!/bin/sh -e
os="$( "$__explorer/os" )"
case "$os" in
freebsd)
sysctl -n kern.disks
;;
openbsd)
sysctl -n hw.disknames | grep -Eo '[sw]d[0-9]+' | xargs
;;
netbsd)
sysctl -n hw.disknames | grep -Eo '[lsw]d[0-9]' | xargs
;;
*)
# hopefully everything else is linux
if command -v lsblk > /dev/null
then
# exclude ram disks, floppies and cdroms
# https://www.kernel.org/doc/Documentation/admin-guide/devices.txt
lsblk -e 1,2,11 -dno name | xargs
else
# fallback
cd /dev && echo [vsh]d?
fi
;;
esac