Skip to content

Commit 1bcf7c7

Browse files
authored
Merge pull request #14 from anoduck/master
Added compatibility for OpenBSD Thx @anoduck !
2 parents e827fae + 2289446 commit 1bcf7c7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

setver.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,11 @@ lookup_script_data() {
11691169
os_version=$(sw_vers -productVersion) # 11.1
11701170
install_package="brew install"
11711171
;;
1172+
OpenBSD)
1173+
os_name=$(uname -s)
1174+
os_version=$(uname -r)
1175+
install_package="pkg_add -U"
1176+
;;
11721177
Linux | GNU*)
11731178
if [[ $(command -v lsb_release) ]]; then
11741179
# 'normal' Linux distributions
@@ -1199,7 +1204,8 @@ lookup_script_data() {
11991204
script_modified="??"
12001205
[[ "$os_kernel" == "Linux" ]] && script_modified=$(stat -c %y "$script_install_path" 2>/dev/null | cut -c1-16) # generic linux
12011206
[[ "$os_kernel" == "Darwin" ]] && script_modified=$(stat -f "%Sm" "$script_install_path" 2>/dev/null) # for MacOS
1202-
1207+
[[ "$os_kernel" == "OpenBSD" ]] && script_modified=$(stat -f "%Sm" "$script_install_path" 2>/dev/null) # for OpenBSD
1208+
12031209
debug "$info_icon Last modif : $script_modified"
12041210
debug "$info_icon Script ID : $script_lines lines / md5: $script_hash"
12051211
debug "$info_icon Creation : $script_created"

0 commit comments

Comments
 (0)