Commit 1b790b06 authored by ssrq's avatar ssrq

[type/__sshd_config] Support macosx

parent 10ca1c12
Pipeline #3408 passed with stage
in 57 seconds
......@@ -20,6 +20,10 @@
joinlines() { sed -n -e H -e "\${x;s/^\\n//;s/\\n/${1:?}/g;p;}"; }
version_ge() {
test "$(printf '%s\n' "$1" "$2" | sort -t. -n -k1 -k2 -k3 | head -n1)" = "$2"
}
state_is=$(cat "${__object:?}/explorer/state")
state_should=$(cat "${__object:?}/parameter/state")
......@@ -43,7 +47,25 @@ in
;;
esac
sshd_config_file=$(cat "${__object:?}/parameter/file")
if test -s "${__object:?}/parameter/file"
then
sshd_config_file=$(cat "${__object:?}/parameter/file")
else
case $(cat "${__global:?}/explorer/os")
in
(macosx)
if version_ge "$(cat "${global:?}/explorer/os_version")" 10.10
then
sshd_config_file='/etc/ssh/sshd_config'
else
sshd_config_file='/etc/sshd_config'
fi
;;
(*)
sshd_config_file='/etc/ssh/sshd_config'
;;
esac
fi
quote() { printf "'%s'" "$(printf '%s' "$*" | sed -e "s/'/'\\\\''/g")"; }
drop_awk_comments() { quote "$(sed '/^[[:blank:]]*#.*$/d;/^$/d' "$@")"; }
......
......@@ -39,6 +39,9 @@ in
(freebsd|netbsd|openbsd)
# whitelist
;;
(macosx)
# whitelist
;;
(openbmc-phosphor)
# whitelist
# OpenBMC can be configured with dropbear and OpenSSH.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment