From cb28e5fddc1a686867a103e50a34199052a764ab Mon Sep 17 00:00:00 2001 From: Sam Detweiler Date: Fri, 22 Nov 2019 06:18:04 -0600 Subject: [PATCH 1/2] watch out for commented lines in config --- run-start.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/run-start.sh b/run-start.sh index a6c07520..cd32fda4 100755 --- a/run-start.sh +++ b/run-start.sh @@ -7,10 +7,12 @@ if [ -z "$DISPLAY" ]; then #If not set DISPLAY is SSH remote or tty fi # get the processor architecture arch=$(uname -m) -# got the config option, if any -serveronly=$(grep -i serveronly: config/config.js | awk '{print tolower($2)}' | tr -d ,\"\') +false='false' +# get the config option, if any +# only check non comment lines +serveronly=$(grep -v '^\s//' config/config.js | grep -i serveronly: | awk '{print tolower($2)}' | tr -d ,\"\') # set default if not defined in config -serveronly="${serveronly:=false}" +serveronly=${serveronly:-false} # check for xwindows running xorg=$(pgrep Xorg) # @@ -58,5 +60,5 @@ if [ "$serveronly." != "false." -o "$arch" == "armv6l" -o "$xorg." == "." ]; t fi else # we can use electron directly - `electron js/electron.js $1`; -fi \ No newline at end of file + electron js/electron.js $1; +fi From 06308210c0c7033bf3ce1cf69397bad58927094d Mon Sep 17 00:00:00 2001 From: Sam Detweiler Date: Sat, 23 Nov 2019 06:57:10 -0600 Subject: [PATCH 2/2] add support for secured apt-get repositories --- installers/raspberry.sh | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/installers/raspberry.sh b/installers/raspberry.sh index 598da28d..eecaa17e 100755 --- a/installers/raspberry.sh +++ b/installers/raspberry.sh @@ -91,14 +91,30 @@ function verlt() { [ "$1" = "$2" ] && return 1 || verlte $1 $2 ;} # Update before first apt-get if [ $mac != 'Darwin' ]; then -echo -e "\e[96mUpdating packages ...\e[90m" | tee -a $logfile -sudo apt-get update || echo -e "\e[91mUpdate failed, carrying on installation ...\e[90m" | tee -a $logfile -fi + echo -e "\e[96mUpdating packages ...\e[90m" | tee -a $logfile + update=$(sudo apt-get update 2>&1) + echo $update >> $logfile + update_rc=$? + if [ $update_rc -ne 0 ]; then + echo -e "\e[91mUpdate failed, retrying installation ...\e[90m" | tee -a $logfile + if [ $(echo $update | grep "apt-secure" | wc -l) -eq 1 ]; then + update=$(sudo apt-get update --allow-releaseinfo-change 2>&1) + echo $update >> $logfile + update_rc=$? + if [ $update_rc -ne 0 ]; then + echo "second apt-get update failed" $update | ree -a $logfile + exit 1 + else + echo "second apt-get update completed ok" >> $logfile + fi + fi + else + echo "apt-get update completed ok" >> $logfile + fi -if [ $mac != 'Darwin' ]; then -# Installing helper tools -echo -e "\e[96mInstalling helper tools ...\e[90m" | tee -a $logfile -sudo apt-get --assume-yes install curl wget git build-essential unzip || exit + # Installing helper tools + echo -e "\e[96mInstalling helper tools ...\e[90m" | tee -a $logfile + sudo apt-get --assume-yes install curl wget git build-essential unzip || exit fi # Check if we need to install or upgrade Node.js. @@ -220,11 +236,11 @@ if $NPM_INSTALL; then # # if this is a mac, npm was installed with node if [ $mac != 'Darwin' ]; then - sudo apt-get install -y npm + sudo apt-get install -y npm >>$logfile fi # update to the latest. echo upgrading npm to latest >> $logfile - sudo npm i -g npm + sudo npm i -g npm >>$logfile echo -e "\e[92mnpm installation Done! version=V$(npm -v)\e[0m" | tee -a $logfile fi