summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--README.md5
-rwxr-xr-xconfigure5
-rw-r--r--shellpass.12
-rwxr-xr-xshellpass.ksh12
5 files changed, 22 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index c981aef..75c1d6b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# Portable makefile supporting OpenBSD and GNU/Linux.
+# Portable makefile supporting OpenBSD, FreeBSD, and GNU/Linux.
PREFIX = /usr/local
INSTALL = install
diff --git a/README.md b/README.md
index 7dd4938..67e6a20 100644
--- a/README.md
+++ b/README.md
@@ -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 \
diff --git a/configure b/configure
index 9a1e936..c9b0f50 100755
--- a/configure
+++ b/configure
@@ -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
}
Generated by cgit. See skreutz.com for my tech blog and contact information.