Skip to content

Commit

Permalink
Added OpenBSD OS information to allow compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
anoduck committed Mar 2, 2024
1 parent e827fae commit d82085d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion setver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,11 @@ lookup_script_data() {
os_version=$(sw_vers -productVersion) # 11.1
install_package="brew install"
;;
OpenBSD)
os_name=$(uname -s)
os_version=$(uname -r)
install_package="pkg_add -U"
;;
Linux | GNU*)
if [[ $(command -v lsb_release) ]]; then
# 'normal' Linux distributions
Expand Down Expand Up @@ -1199,7 +1204,8 @@ lookup_script_data() {
script_modified="??"
[[ "$os_kernel" == "Linux" ]] && script_modified=$(stat -c %y "$script_install_path" 2>/dev/null | cut -c1-16) # generic linux
[[ "$os_kernel" == "Darwin" ]] && script_modified=$(stat -f "%Sm" "$script_install_path" 2>/dev/null) # for MacOS

[[ "$os_kernel" == "OpenBSD" ]] && script_modified=$(stat -f "%Sm" "$script_install_path" 2>/dev/null) # for MacOS

debug "$info_icon Last modif : $script_modified"
debug "$info_icon Script ID : $script_lines lines / md5: $script_hash"
debug "$info_icon Creation : $script_created"
Expand Down

0 comments on commit d82085d

Please sign in to comment.