@@ -39,16 +39,16 @@ function _is_macos() {
3939
4040function _install_unzip() {
4141 if _is_centos; then
42- yum install -y unzip
42+ sudo yum install -y unzip
4343 else
44- apt-get install -y --no-install-recommends unzip
44+ sudo apt-get install -y --no-install-recommends unzip
4545 fi
4646}
4747
4848function _install_aws_cli_linux() {
4949 curl -sS " https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o " /tmp/awscliv2.zip"
5050 unzip -o -q -d /tmp/ /tmp/awscliv2.zip
51- /tmp/aws/install --update
51+ sudo /tmp/aws/install --update
5252}
5353
5454function _install_aws_cli_macos() {
@@ -92,11 +92,11 @@ function _install_ssm_agent() {
9292function _install_session_manager_plugin_ubuntu() {
9393 curl -sS " https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" \
9494 -o " /tmp/session-manager-plugin.deb"
95- dpkg -i /tmp/session-manager-plugin.deb
95+ sudo dpkg -i /tmp/session-manager-plugin.deb
9696}
9797
9898function _install_session_manager_plugin_centos() {
99- yum install -y " https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm" \
99+ sudo yum install -y " https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm" \
100100 || echo " Already installed?"
101101}
102102
@@ -123,11 +123,11 @@ function _install_session_manager_plugin() {
123123
124124
125125function _install_curl_ubuntu() {
126- apt-get install -y --no-install-recommends curl
126+ sudo apt-get install -y --no-install-recommends curl
127127}
128128
129129function _install_curl_centos() {
130- yum install -y curl
130+ sudo yum install -y curl
131131}
132132
133133function _install_curl() {
@@ -153,3 +153,14 @@ function _install_sudo() {
153153 apt-get install -y --no-install-recommends sudo
154154 fi
155155}
156+
157+ function _install_noVNC_linux() {
158+ json_value_regexp=' s/^[^"]*".*": \"\(.*\)\"[^"]*/\1/'
159+ latest_noVNC_release=$( curl -s https://api.github.com/repos/novnc/noVNC/releases/latest)
160+
161+ novnc_tag=$( echo " $latest_noVNC_release " | grep " tag_name" | sed -e " $json_value_regexp " )
162+ echo " Got latest noVNC release tag: $novnc_tag "
163+
164+ curl -sSL " https://api.github.com/repos/novnc/noVNC/tarball/$novnc_tag " -o " /tmp/noVNC.tgz"
165+ tar xzf /tmp/noVNC.tgz --transform ' s/^novnc-noVNC-[0-9a-f]\+/noVNC/'
166+ }
0 commit comments