Commit c6aba8d1 authored by ssrq's avatar ssrq

[explorer/disks] Fix for NetBSD

When connecting over SSH and running /bin/sh, the PATH is missing sbin locations.
sysctl is located at /sbin/sysctl on NetBSD.
parent 49fc21ec
#!/bin/sh
#!/bin/sh -e
uname_s="$(uname -s)"
case "${uname_s}" in
case $uname_s in
FreeBSD)
sysctl -n kern.disks
;;
OpenBSD|NetBSD)
OpenBSD)
sysctl -n hw.disknames | grep -Eo '[lsw]d[0-9]+' | xargs
;;
NetBSD)
PATH="${PATH}:/usr/local/sbin:/usr/sbin:/sbin"
sysctl -n hw.disknames \
| awk 'BEGIN { RS = " " } /^[lsw]d[0-9]+/' \
| xargs
;;
Linux)
if command -v lsblk > /dev/null
then
......@@ -23,5 +29,3 @@ case "${uname_s}" in
printf "Don't know how to list disks for %s operating system, if you can please submit a patch\n" "${uname_s}" >&2
;;
esac
exit 0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment