Skip to content
Open
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions src/linux/lib/smartdc/mdata-get
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,19 @@ case $(uname -s) in
esac

if [[ -n ${NC_SOCK} ]]; then
if [[ ! -e ${NC_SOCK} ]]; then
echo "mdata-get: socket not accessible" >&2
exit 2
fi

coproc nc -U ${NC_SOCK}
exec <&${COPROC[0]} 3>&${COPROC[1]}
else
if [[ ! -e ${SERIAL_DEV} ]]; then
echo "mdata-get: socket not accessible" >&2
exit 2
fi

exec <${SERIAL_DEV} 3>>${SERIAL_DEV}
fi

Expand Down
2 changes: 2 additions & 0 deletions src/linux/lib/smartdc/run-user-script
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ if [[ $? -eq 0 ]] ; then
chmod +x /root/user-script
exec /root/user-script
fi
else
rm -f /root/user-script
fi
2 changes: 1 addition & 1 deletion src/linux/lib/smartdc/set-root-authorized-keys
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

if [[ ! -f /root/.ssh/authorized_keys ]]; then
authorized_keys=$(/lib/smartdc/mdata-get root_authorized_keys 2>>/dev/console)
if [[ -n ${authorized_keys} ]]; then
if [[ $? -eq 0 && -n ${authorized_keys} ]]; then
mkdir -p /root/.ssh
echo "${authorized_keys}" > /root/.ssh/authorized_keys
chmod 700 /root/.ssh
Expand Down