From 30fa0dbb5e447941e426d0d06d5f069428bd4008 Mon Sep 17 00:00:00 2001 From: Pothi Kalimuthu <1254302+pothi@users.noreply.github.com> Date: Mon, 3 Jan 2022 21:20:55 +0530 Subject: [PATCH] Rewrite the logic to fetch the public SSH key --- hap-ac2-init.rsc | 6 ++++-- sxt-lte-init.rsc | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hap-ac2-init.rsc b/hap-ac2-init.rsc index 2747a96..48c5ed1 100644 --- a/hap-ac2-init.rsc +++ b/hap-ac2-init.rsc @@ -60,8 +60,10 @@ # install public SSH key :put "Configuring SSH..."; -/tool fetch https://launchpad.net/~pothi/+sshkeys dst-path=pothi-ssh-key-rsa; -:delay 5s; +{ + :local result [ /tool fetch https://launchpad.net/~pothi/+sshkeys dst-path=pothi-ssh-key-rsa as-value]; + :do { :delay 2s } while=( $result->"status" != "finished" ) +} /user ssh-keys import public-key-file=pothi-ssh-key-rsa; /file remove pothi-ssh-key-rsa; diff --git a/sxt-lte-init.rsc b/sxt-lte-init.rsc index 5d463e5..ba3b31b 100644 --- a/sxt-lte-init.rsc +++ b/sxt-lte-init.rsc @@ -44,8 +44,10 @@ # Wireless tweaks # install public SSH key -/tool fetch https://launchpad.net/~pothi/+sshkeys dst-path=pothi-ssh-key-rsa; -:delay 5s; +{ + :local result [ /tool fetch https://launchpad.net/~pothi/+sshkeys dst-path=pothi-ssh-key-rsa as-value]; + :while ($result->"status" != "finished") do={ :delay 2s } +} /user ssh-keys import public-key-file=pothi-ssh-key-rsa; /file remove pothi-ssh-key-rsa;