Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added compatibility for OpenBSD #14

Merged
merged 2 commits into from
Mar 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 OpenBSD

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
Loading