From 798a062b5c421a03795203942afdd77ef60bae88 Mon Sep 17 00:00:00 2001 From: Dominik Dzienia Date: Mon, 4 Sep 2023 11:30:05 +0000 Subject: [PATCH] Fixed newer Ubuntu Node install --- install.sh | 12 ++++++++++-- package.json | 2 +- src/lib.sh | 10 +++++++++- src/setup.sh | 2 +- updated | 2 +- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index c200af5..6c2059e 100644 --- a/install.sh +++ b/install.sh @@ -1,6 +1,6 @@ #!/bin/bash -### version: 1.3.0 +### version: 1.3.1 # ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.# # Nightscout Mikr.us setup script # @@ -33,7 +33,7 @@ MONGO_DB_DIR=/srv/nightscout/data/mongodb TOOL_FILE=/srv/nightscout/tools/nightscout-tool TOOL_LINK=/usr/bin/nightscout-tool UPDATES_DIR=/srv/nightscout/updates -SCRIPT_VERSION="1.3.0" #auto-update +SCRIPT_VERSION="1.3.1" #auto-update SCRIPT_BUILD_TIME="2023.09.04" #auto-update #======================================= @@ -405,6 +405,14 @@ setup_node() { if [ $RESULT -eq 0 ]; then msgcheck "Node installed in correct version" else + ohai "Cleaning old Node.js" + + rm -f /etc/apt/sources.list.d/nodesource.list 2> /dev/null + + apt-get -yq --fix-broken install + apt-get -yq update + apt-get -yq remove nodejs nodejs-doc libnode* + ohai "Preparing Node.js setup" curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - >/dev/null 2>&1 diff --git a/package.json b/package.json index 646f747..2c076f0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dlvoy/ns-installer-mikrus", - "version": "1.3.0", + "version": "1.3.1", "description": "Nightscout installer for mikr.us VPS", "main": "index.js", "scripts": { diff --git a/src/lib.sh b/src/lib.sh index 237e3eb..f355b17 100644 --- a/src/lib.sh +++ b/src/lib.sh @@ -17,7 +17,7 @@ MONGO_DB_DIR=/srv/nightscout/data/mongodb TOOL_FILE=/srv/nightscout/tools/nightscout-tool TOOL_LINK=/usr/bin/nightscout-tool UPDATES_DIR=/srv/nightscout/updates -SCRIPT_VERSION="1.3.0" #auto-update +SCRIPT_VERSION="1.3.1" #auto-update SCRIPT_BUILD_TIME="2023.09.04" #auto-update #======================================= @@ -389,6 +389,14 @@ setup_node() { if [ $RESULT -eq 0 ]; then msgcheck "Node installed in correct version" else + ohai "Cleaning old Node.js" + + rm -f /etc/apt/sources.list.d/nodesource.list 2> /dev/null + + apt-get -yq --fix-broken install + apt-get -yq update + apt-get -yq remove nodejs nodejs-doc libnode* + ohai "Preparing Node.js setup" curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - >/dev/null 2>&1 diff --git a/src/setup.sh b/src/setup.sh index eac50d3..5934905 100755 --- a/src/setup.sh +++ b/src/setup.sh @@ -1,6 +1,6 @@ #!/bin/bash -### version: 1.3.0 +### version: 1.3.1 # ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.# # Nightscout Mikr.us setup script # diff --git a/updated b/updated index eff252c..583afe1 100644 --- a/updated +++ b/updated @@ -1 +1 @@ -2023-09-04T10:16:19.295Z \ No newline at end of file +2023-09-04T11:29:41.442Z \ No newline at end of file