diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | README.md | 5 | ||||
-rwxr-xr-x | configure | 5 | ||||
-rw-r--r-- | shellpass.1 | 2 | ||||
-rwxr-xr-x | shellpass.ksh | 12 |
5 files changed, 22 insertions, 4 deletions
@@ -1,4 +1,4 @@ -# Portable makefile supporting OpenBSD and GNU/Linux. +# Portable makefile supporting OpenBSD, FreeBSD, and GNU/Linux. PREFIX = /usr/local INSTALL = install @@ -33,6 +33,11 @@ On OpenBSD you can install the dependencies using `pkg_add(1)`: $ doas pkg_add gnupg vim fzf libqrencode xclip $ doas ln -s /bin/ksh /usr/local/bin/oksh +On FreeBSD you can install the dependencies using `pkg-install(8)`: + + $ sudo pkg install oksh gnupg vim fzf libqrencode xclip wl-clipboard \ + coreutils + On Void Linux you can install the dependencies using `xbps-install(1)`: $ sudo xbps-install -S oksh gnupg vim fzf qrencode xclip wl-clipboard \ @@ -10,6 +10,11 @@ case "$( uname )" in echo 'BINGRP = bin' 1>&3 echo 'MANGRP = bin' 1>&3 ;; + FreeBSD) + echo 'BINGRP = wheel' 1>&3 + echo 'MANDIR = share/man/man' 1>&3 + echo 'MANGRP = wheel' 1>&3 + ;; Linux) echo 'BINMODE = 755' 1>&3 echo 'MANMODE = 644' 1>&3 diff --git a/shellpass.1 b/shellpass.1 index 5b1bd1d..6b955b0 100644 --- a/shellpass.1 +++ b/shellpass.1 @@ -94,4 +94,4 @@ See .Xr mount_mfs 8 on OpenBSD, or .Xr tmpfs 5 -on Linux. +on FreeBSD. diff --git a/shellpass.ksh b/shellpass.ksh index 9e91c85..1da0a29 100755 --- a/shellpass.ksh +++ b/shellpass.ksh @@ -108,6 +108,10 @@ function edit { function shred { if [ "$( uname )" == "OpenBSD" ] ; then rm -fP -- "$@" + elif [ "$( uname )" == "FreeBSD" ] ; then + for f in "$@" ; do + [ -e "$f" ] && command gshred -fun 1 -- "$f" + done else for f in "$@" ; do [ -e "$f" ] && command shred -fun 1 -- "$f" @@ -119,11 +123,15 @@ function mktemp { if [ "$( uname )" == "OpenBSD" ] ; then df -P "${TMPDIR:-/tmp}" | sed '2q;d' | grep -q '^mfs:' || err_exit "temporary directory ${TMPDIR:-/tmp} must be on mfs" - command mktemp -t + command mktemp -t shellpass.XXXXXX + elif [ "$( uname )" == "FreeBSD" ] ; then + df "${TMPDIR:-/tmp}" | sed '2q;d' | grep -q '^tmpfs[[:space:]]' || + err_exit "temporary directory ${TMPDIR:-/tmp} must be on tmpfs" + command mktemp -t shellpass.XXXXXX else [[ -d /dev/shm && -x /dev/shm && -w /dev/shm ]] || err_exit "cannot create temporary file in /dev/shm" - command mktemp --tmpdir=/dev/shm + command mktemp --tmpdir=/dev/shm shellpass.XXXXXX fi } |