Snippets

Peter Scargill "The Script"

Updated by Peter Scargill

File script.sh Modified

  • Ignore whitespace
  • Hide word diff
 ##
-##  "The Script" version 5:30pm UK time May 13, 2020 updates reference to http://tech.scargill.net to the https version, 
+##  "The Script" version 5:30pm May 13, 2020 updates reference to http://tech.scargill.net to the https version, 
 ##  improves remote root access and fixes/improves basic web page, removes DarkSky node and adds in the MICRO editor 
 ##  December 19 2019 fixed a connection check
 ##  Previous updates includes changes to handle Raspbian Buster, RPi4 and other recent changes
 
 if [[ $OPSYS == *"RASPBIAN"* ]];then
     MYMENU=$(whiptail --title "Peter Scargill's 'The Script' Main Menu for Raspberry Pi" --checklist \
-        "\n   Make your selections (SPACE) as required then TAB to OK/Cancel" 28 73 19 \
+        "\n   Make your selections (SPACE) as required then TAB to OK/Cancel" 27 73 18 \
         "quiet" "Quiet(er) install - untick for lots of info " ON \
         "prereq" "Install general pre-requisites " ON \
         "mosquitto" "Install Mosquitto" ON \
         "modpass" "Mod USER and ADMIN passwords (password123)" ON \
         "addindex" "Add a basic index page and CSS" ON \
         "passwords" "Update ROOT and PI user passwords" OFF \
-        "habridge" "Install HA-bridge on port 82" OFF \
         "rpiclone" "Install RPI-Clone" ON \
         "log2ram" "Install Log2RAM default 40 Meg" OFF \
 		    "grafana" "Install Grafana and InfluxDB" OFF \
         "office" "Remove LibreOffice on PI to save space" OFF 3>&1 1>&2 2>&3)
 else
     MYMENU=$(whiptail --title "Peter Scargill's 'The Script' Main Non-Pi Menu" --checklist \
-        "\n   Make your selections (SPACE) as required then TAB to OK/Cancel" 29 73 21 \
+        "\n   Make your selections (SPACE) as required then TAB to OK/Cancel" 28 73 20 \
         "quiet" "Quiet(er) install - untick for lots of info " ON \
         "prereq" "Install general pre-requisites" ON \
         "mosquitto" "Install Mosquitto" ON \
         "modpass" "Mod USER and ADMIN passwords (password123)" ON \
         "addindex" "Add an index page and some CSS" ON \
         "passwords" "Update ROOT and PI user passwords" OFF \
-        "habridge" "Install HA-bridge on port 82" OFF \
         "rpiclone" "Install RPI-Clone" ON \
         "log2ram" "Install Log2RAM default 40Meg" OFF \
-		    "grafana" "Install Grafana and InfluxDB" OFF 3>&1 1>&2 2>&3)
+		"grafana" "Install Grafana and InfluxDB" OFF 3>&1 1>&2 2>&3)
 fi
 
 if [[ $MYMENU != *"quiet"* ]]; then
     sudo update-rc.d rsyslog disable 2>&1 | tee -a $LOGFILE
     sudo locale-gen 2>&1 | tee -a $LOGFILE
     sudo sed -i -e 's#exit 0##g' /etc/rc.local
-    echo "cd /home/pi/habridge" | sudo tee -a /etc/rc.local > /dev/null
-    echo "[ -f /home/pi/habridge/habridge-log.txt ] && rm /home/pi/habridge/habridge-log.txt" | sudo tee -a /etc/rc.local > /dev/null
-    echo "nohup /usr/bin/java -jar -Dserver.port=82 -Dconfig.file=/home/pi/habridge/data/habridge.config /home/pi/habridge/ha-bridge.jar > /home/pi/habridge/habridge-log.txt 2>&1 &" | sudo tee -a /etc/rc.local > /dev/null
-    echo "chmod 777 /home/pi/habridge/habridge-log.txt" | sudo tee -a /etc/rc.local > /dev/null
+  #  ha-bridge used to be here
     echo "exit 0" | sudo tee -a /etc/rc.local > /dev/null
 fi
 
 	fi
 fi
 
-if [[ $MYMENU == *"habridge"* ]]; then
-    printstatus "Installing HA-Bridge on port 82"
-    #sudo sed -i -e 's#80#81#g' /etc/apache2/ports.conf
-    #sudo sed -i -e 's#80#81#g' /etc/apache2/sites-enabled/000-default.conf
-    #sudo service apache2 restart
-    ## now to install HA-Bridge on port 82 and get it running from power up.
-    cd ~
-    mkdir habridge
-    cd habridge
-    #wget https://github.com/bwssytems/ha-bridge/releases/download/v3.5.1/ha-bridge-3.5.1.jar -O ~/habridge/ha-bridge.jar
-    curl -s https://api.github.com/repos/bwssytems/ha-bridge/releases/latest | jq --raw-output '.assets[0] | .browser_download_url' | wget -i - -O ~/habridge/ha-bridge.jar
-    echo -e "[Unit]\n\
-Description=HA Bridge\n\
-Wants=network.target\n\
-After=network.target\n\
-\n\
-[Service]\n\
-Type=simple\n\
-ExecStart=/usr/bin/java -jar -Dserver.port=82 -Dconfig.file=/home/pi/habridge/data/habridge.config /home/pi/habridge/ha-bridge.jar\n\
-\n\
-[Install]\n\
-    WantedBy=multi-user.target\n" | sudo tee /lib/systemd/system/habridge.service
-    sudo systemctl  start habridge.service 2>&1 | tee -a $LOGFILE
-    sudo systemctl enable habridge.service 2>&1 | tee -a $LOGFILE
-fi
-
-
 
 if [[ $MYMENU == *"phpsysinfo"* ]]; then
     printstatus "Installing PHPSysInfo"
 
 
 cd
-curl $NQUIET https://getmic.ro | bash
+curl -s -S https://getmic.ro | bash
 sudo apt install $AQUIET -y  xclip
 
 
 if [ ! -f /home/pi/AlreadyBashed ]; then
 	sudo touch /home/pi/AlreadyBashed
 
-
 sudo wget -a $LOGFILE $AQUIET https://www.scargill.net/iot/bashrc.txt -O /tmp/bashrc.txt
-cat /tmp/bashrc.txt | sudo tee -a /etc/bash.bashrc > /dev/null 2>&1
-		
+cat /tmp/bashrc.txt | sudo tee -a /etc/bash.bashrc > /dev/null 2>&1		
 
 sudo tee -a /etc/profile > /dev/null <<EOT
 export MICRO_TRUECOLOR=1
 
 fi
 
-
 printstatus  "COMPLETE - PLEASE REBOOT NOW THEN TEST"
Updated by Peter Scargill

File script.sh Modified

  • Ignore whitespace
  • Hide word diff
 ##
-##  "The Script" version May 13, 2020 updates reference to http://tech.scargill.net to the https version, 
+##  "The Script" version 5:30pm UK time May 13, 2020 updates reference to http://tech.scargill.net to the https version, 
 ##  improves remote root access and fixes/improves basic web page, removes DarkSky node and adds in the MICRO editor 
 ##  December 19 2019 fixed a connection check
 ##  Previous updates includes changes to handle Raspbian Buster, RPi4 and other recent changes
 echo "alias space='df -h|grep -v udev|grep -v tmpfs|grep -v run'" | sudo tee -a /etc/bash.bashrc > /dev/null 2>&1
 
 if [ ! -f /home/pi/AlreadyBashed ]; then
-sudo touch /home/pi/AlreadyBashed
-sudo tee -a /etc/bash.bashrc > /dev/null <<EOT
-PS1="\[\033[38;5;39m\]\u\[$(tput sgr0)\]\[\033[38;5;15m\]@\[$(tput sgr0)\]\[\033[38;5;222m\]\h\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]\[\033[38;5;83m\]\W\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]\[\033[38;5;69m\]\A\[$(tput sgr0)\]\[\033[38;5;15m\][\[$(tput sgr0)\]\[\033[38;5;174m\]\$?\[$(tput sgr0)\]\[\033[38;5;15m\]]> \[$(tput sgr0)\]"
-
-BLACK='\033[0;30m'
-RED='\033[0;31m'
-GREEN='\033[0;32m'
-BROWN='\033[0;33m'
-BLUE='\033[0;34m'
-PURPLE='\033[0;35m'
-CYAN='\033[0;36m'
-LIGHTGRAY='\033[0;37m'
-DARKGRAY='\033[1;30m'
-LIGHTRED='\033[1;31m'
-LIGHTGREEN='\033[1;32m'
-YELLOW='\033[1;33m'
-LIGHTBLUE='\033[1;34m'
-LIGHTPURPLE='\033[1;35m'
-LIGHTCYAN='\033[1;36m'
-WHITE='\033[1;37m'
-NC='\033[0m'
-
-
-alias mqttlog='tail -f /var/log/mosquitto/mosquitto.log | ccze -A'
-alias nrlog='sudo journalctl -f -n 50 -u nodered -o cat | ccze -A'
-alias space='df -h|grep -v udev|grep -v tmpfs|grep -v run'  
-alias cls='python /home/pi/cls.py'
-alias stop='sudo shutdown now'
-alias boot='sudo reboot'
-alias partitions='cat /proc/partitions'
-alias parts='sudo fdisk -l /dev/mmc* /dev/sd*'
-alias cloned="sudo printf 'Last cloned on ' && sudo tune2fs -l /dev/sda2|grep -i write|grep -iv life|cut -d: -f 2-|xargs"
-alias e="./micro"
-alias se="./micro"
-
-#optional hostnames in 4 functions below
-clone () {
-printf "${LIGHTBLUE}Creating a quick clone on SDA${NC}\n"
-touch /home/pi/clone-date
-bashCmd=(sudo rpi-clone -U sda)
-if [ -n "$1" ];  then
-bashCmd+=(-s "$1")
-fi
-"${bashCmd[@]}"
-}
-
-cclone () {
-printf "${LIGHTRED}Creating a full clone on SDA${NC}\n"
-touch /home/pi/clone-date
-bashCmd=(sudo rpi-clone -f -U sda)
-if [ -n "$1" ];  then
-bashCmd+=(-s "$1")
-fi
-"${bashCmd[@]}"
-}
+	sudo touch /home/pi/AlreadyBashed
 
-cloneb () {
-printf "${LIGHTBLUE}Creating a quick clone on SDB${NC}\n"
-touch /home/pi/clone-date
-bashCmd=(sudo rpi-clone -U sdb)
-if [ -n "$1" ];  then
-bashCmd+=(-s "$1")
-fi
-"${bashCmd[@]}"
-}
 
-ccloneb () {
-printf "${LIGHTRED}Creating a full clone on SDB${NC}\n"
-touch /home/pi/clone-date
-bashCmd=(sudo rpi-clone -f -U sdb)
-if [ -n "$1" ];  then
-bashCmd+=(-s "$1")
-fi
-"${bashCmd[@]}"
-}
-
-update () {
-printf "${LIGHTGREEN}Getting upgrades...${NC}"
-sudo apt update
-sudo apt upgrade
-}
-
-created () {
-printf "${LIGHTGREEN}This setup was created at ${YELLOW}"
-bashCmd=(date -r /home/pi/clone-date +"%H:%M on %-d/%m/%Y")
-"${bashCmd[@]}"
-printf "${NC}"
-}
-EOT
+sudo wget -a $LOGFILE $AQUIET https://www.scargill.net/iot/bashrc.txt -O /tmp/bashrc.txt
+cat /tmp/bashrc.txt | sudo tee -a /etc/bash.bashrc > /dev/null 2>&1
+		
 
 sudo tee -a /etc/profile > /dev/null <<EOT
 export MICRO_TRUECOLOR=1
Updated by Peter Scargill

File script.sh Modified

  • Ignore whitespace
  • Hide word diff
 ##
-##  "The Script" version May 12, 2020 updates reference to http://tech.scargill.net to the https version, 
-##  adds "micro" editor, improves remote root access and fixes/improves basic web page, removes DarkSky node 
+##  "The Script" version May 13, 2020 updates reference to http://tech.scargill.net to the https version, 
+##  improves remote root access and fixes/improves basic web page, removes DarkSky node and adds in the MICRO editor 
 ##  December 19 2019 fixed a connection check
 ##  Previous updates includes changes to handle Raspbian Buster, RPi4 and other recent changes
 ##  including the latest Node/Node-Red updates (at this time v1.0.2) on Raspbian 
 ##  and the full version works just as well)
 ##  See also: BigTimer, ESP-GO and other included Node-Red nodes of mine
 ##
-##  Many thanks to Antonio (Mr Shark) for his work.
+##  Many thanks to Antonio (Mr Shark) for his help.
 ##
 ##  Mosquitto (port 1883) with web sockets (Port 9001)
 ##  SQLITE ( xxx.xxx.xxx.xxx/phpliteadmin),
 #############################################################################
 ##
 
-printstatus "Welcome to THE SCRIPT!"
+printstatus "Welcome to 'The Script'"
 
 AQUIET="-qq"
 NQUIET="-s"
         exit
     fi
 else
-	sudo touch /etc/AlreadyRun
+	if [[ $OPSYS != *"RASPBIAN"* ]]; then
+		sudo touch /etc/AlreadyRun
+	fi
 fi
 
 if [ ! -f /etc/AlreadyRun ]; then
 	sudo sysctl -p
 
 	printstatus "Allow remote root login and speed up SSH"
-	sudo sed -i -e 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config
-	sudo sed -i -e 's/PermitRootLogin without-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
-	sudo sed -i -e 's/PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
 	sudo sed -i -e 's/#PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config
 	sudo sed -i -e 's/#PermitRootLogin without-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
 	sudo sed -i -e 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
+	sudo sed -i -e 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config
+	sudo sed -i -e 's/PermitRootLogin without-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
+	sudo sed -i -e 's/PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
 	sudo sed -i -e 's/TCPKeepAlive yes/TCPKeepAlive no/g' /etc/ssh/sshd_config
 	sudo sed -i '$ a UseDNS no' /etc/ssh/sshd_config
 	sudo sed -i '$ a ClientAliveInterval 30' /etc/ssh/sshd_config
     sudo apt-get install avahi-daemon avahi-utils -y 2>&1 | tee -a $LOGFILE
     sudo sed -i -e 's/use-ipv6=yes/use-ipv6=no/g' /etc/avahi/avahi-daemon.conf
 else
-        printstatus "Script is re-running, avoiding un-necessary repeats"
+        printstatus "'The Script' is re-running, avoiding un-necessary repeats"
 fi
 
 if [[ $OPSYS == "LINUXMINT" ]]; then
 SECONDS=0
 
 if [[ $OPSYS == *"RASPBIAN"* ]];then
-    MYMENU=$(whiptail --title "Main Raspberry Pi Selection" --checklist \
-        "\nSelect items for your Pi as required then hit OK" 28 73 21 \
+    MYMENU=$(whiptail --title "Peter Scargill's 'The Script' Main Menu for Raspberry Pi" --checklist \
+        "\n   Make your selections (SPACE) as required then TAB to OK/Cancel" 28 73 19 \
         "quiet" "Quiet(er) install - untick for lots of info " ON \
         "prereq" "Install general pre-requisites " ON \
         "mosquitto" "Install Mosquitto" ON \
         "apache" "Install Apache/PHP/SQLITE + PHPLITEADMIN " ON \
-        "nodenew" "Install NodeJS and NodeRed (NEW)" ON \
-        "nodejs" "Install NodeJS" OFF \
-        "nodered" "Install Node-Red" OFF \
+        "nodenew" "Install NodeJS and NodeRed (Raspberry Pi)" ON \
         "webmin" "Install Webmin" OFF \
         "java" "Update Java" OFF \
         "hwsupport" "Enable support for Serial, I2C, GPIO, etc" OFF \
         "wiringpi" "Wiring Pi for the GPIO utility" OFF \
         "phpsysinfo" "Install PHPSYSYINFO" ON \
         "modpass" "Mod USER and ADMIN passwords (password123)" ON \
-        "addindex" "Add an index page and some CSS" ON \
+        "addindex" "Add a basic index page and CSS" ON \
         "passwords" "Update ROOT and PI user passwords" OFF \
         "habridge" "Install HA-bridge on port 82" OFF \
         "rpiclone" "Install RPI-Clone" ON \
         "log2ram" "Install Log2RAM default 40 Meg" OFF \
-		"grafana" "Install Grafana and InfluxDB" OFF \
- 		"wolfram" "Remove Wolfram on a PI to save space" OFF \
+		    "grafana" "Install Grafana and InfluxDB" OFF \
+ 		    "wolfram" "Remove Wolfram on a PI to save space" OFF \
         "office" "Remove LibreOffice on PI to save space" OFF 3>&1 1>&2 2>&3)
 else
-    MYMENU=$(whiptail --title "Main Non-Pi Selection" --checklist \
-        "\nSelect items as required then hit OK" 30 73 23 \
+    MYMENU=$(whiptail --title "Peter Scargill's 'The Script' Main Non-Pi Menu" --checklist \
+        "\n   Make your selections (SPACE) as required then TAB to OK/Cancel" 29 73 21 \
         "quiet" "Quiet(er) install - untick for lots of info " ON \
         "prereq" "Install general pre-requisites" ON \
         "mosquitto" "Install Mosquitto" ON \
         "habridge" "Install HA-bridge on port 82" OFF \
         "rpiclone" "Install RPI-Clone" ON \
         "log2ram" "Install Log2RAM default 40Meg" OFF \
-		"grafana" "Install Grafana and InfluxDB" OFF 3>&1 1>&2 2>&3)
+		    "grafana" "Install Grafana and InfluxDB" OFF 3>&1 1>&2 2>&3)
 fi
 
 if [[ $MYMENU != *"quiet"* ]]; then
     fi
 fi
 
+
 cd
-curl -s https://getmic.ro | bash
-sudo apt install xclip -qq
+curl $NQUIET https://getmic.ro | bash
+sudo apt install $AQUIET -y  xclip
+
 
 sudo rm -rf /var/cache/apt/archives/apt-fast
-sudo apt-get $AQUIET -y clean 2>&1 | tee -a $LOGFILE
 
+sudo apt-get $AQUIET -y clean 2>&1 | tee -a $LOGFILE
 myip=$(hostname -I)
 thehostname=$(hostname)
 echo $newhostname | sudo tee /etc/hostname > /dev/null 2>&1
 sudo sed -i '/^127.0.1.1/ d' /etc/hosts > /dev/null 2>&1
 echo 127.0.1.1 $newhostname | sudo tee -a /etc/hosts > /dev/null 2>&1
-sudo /etc/init.d/hostname.sh > /dev/null 2>&1
+#sudo /etc/init.d/hostname.sh > /dev/null 2>&1
 
 #printstatus "Installing Glances"
 #sudo apt-get -y install python{,3}-setuptools 2>&1 | tee -a $LOGFILE
 sudo grep -h ^deb /etc/apt/sources.list /etc/apt/sources.list.d/* 2>&1 >> $LOGFILE
 echo "alias space='df -h|grep -v udev|grep -v tmpfs|grep -v run'" | sudo tee -a /etc/bash.bashrc > /dev/null 2>&1
 
+if [ ! -f /home/pi/AlreadyBashed ]; then
+sudo touch /home/pi/AlreadyBashed
+sudo tee -a /etc/bash.bashrc > /dev/null <<EOT
+PS1="\[\033[38;5;39m\]\u\[$(tput sgr0)\]\[\033[38;5;15m\]@\[$(tput sgr0)\]\[\033[38;5;222m\]\h\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]\[\033[38;5;83m\]\W\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]\[\033[38;5;69m\]\A\[$(tput sgr0)\]\[\033[38;5;15m\][\[$(tput sgr0)\]\[\033[38;5;174m\]\$?\[$(tput sgr0)\]\[\033[38;5;15m\]]> \[$(tput sgr0)\]"
+
+BLACK='\033[0;30m'
+RED='\033[0;31m'
+GREEN='\033[0;32m'
+BROWN='\033[0;33m'
+BLUE='\033[0;34m'
+PURPLE='\033[0;35m'
+CYAN='\033[0;36m'
+LIGHTGRAY='\033[0;37m'
+DARKGRAY='\033[1;30m'
+LIGHTRED='\033[1;31m'
+LIGHTGREEN='\033[1;32m'
+YELLOW='\033[1;33m'
+LIGHTBLUE='\033[1;34m'
+LIGHTPURPLE='\033[1;35m'
+LIGHTCYAN='\033[1;36m'
+WHITE='\033[1;37m'
+NC='\033[0m'
+
+
+alias mqttlog='tail -f /var/log/mosquitto/mosquitto.log | ccze -A'
+alias nrlog='sudo journalctl -f -n 50 -u nodered -o cat | ccze -A'
+alias space='df -h|grep -v udev|grep -v tmpfs|grep -v run'  
+alias cls='python /home/pi/cls.py'
+alias stop='sudo shutdown now'
+alias boot='sudo reboot'
+alias partitions='cat /proc/partitions'
+alias parts='sudo fdisk -l /dev/mmc* /dev/sd*'
+alias cloned="sudo printf 'Last cloned on ' && sudo tune2fs -l /dev/sda2|grep -i write|grep -iv life|cut -d: -f 2-|xargs"
+alias e="./micro"
+alias se="./micro"
+
+#optional hostnames in 4 functions below
+clone () {
+printf "${LIGHTBLUE}Creating a quick clone on SDA${NC}\n"
+touch /home/pi/clone-date
+bashCmd=(sudo rpi-clone -U sda)
+if [ -n "$1" ];  then
+bashCmd+=(-s "$1")
+fi
+"${bashCmd[@]}"
+}
+
+cclone () {
+printf "${LIGHTRED}Creating a full clone on SDA${NC}\n"
+touch /home/pi/clone-date
+bashCmd=(sudo rpi-clone -f -U sda)
+if [ -n "$1" ];  then
+bashCmd+=(-s "$1")
+fi
+"${bashCmd[@]}"
+}
+
+cloneb () {
+printf "${LIGHTBLUE}Creating a quick clone on SDB${NC}\n"
+touch /home/pi/clone-date
+bashCmd=(sudo rpi-clone -U sdb)
+if [ -n "$1" ];  then
+bashCmd+=(-s "$1")
+fi
+"${bashCmd[@]}"
+}
+
+ccloneb () {
+printf "${LIGHTRED}Creating a full clone on SDB${NC}\n"
+touch /home/pi/clone-date
+bashCmd=(sudo rpi-clone -f -U sdb)
+if [ -n "$1" ];  then
+bashCmd+=(-s "$1")
+fi
+"${bashCmd[@]}"
+}
+
+update () {
+printf "${LIGHTGREEN}Getting upgrades...${NC}"
+sudo apt update
+sudo apt upgrade
+}
+
+created () {
+printf "${LIGHTGREEN}This setup was created at ${YELLOW}"
+bashCmd=(date -r /home/pi/clone-date +"%H:%M on %-d/%m/%Y")
+"${bashCmd[@]}"
+printf "${NC}"
+}
+EOT
+
+sudo tee -a /etc/profile > /dev/null <<EOT
+export MICRO_TRUECOLOR=1
+export COLORTERM=24bit
+EOT
+
+fi
+
 
-printstatus  "ALL DONE - PLEASE REBOOT NOW THEN TEST"
+printstatus  "COMPLETE - PLEASE REBOOT NOW THEN TEST"
Updated by Peter Scargill

File script.sh Modified

  • Ignore whitespace
  • Hide word diff
 ##
-##  "The Script" version May 11, 2020 updates reference to http://tech.scargill.net to the https version, 
+##  "The Script" version May 12, 2020 updates reference to http://tech.scargill.net to the https version, 
 ##  adds "micro" editor, improves remote root access and fixes/improves basic web page, removes DarkSky node 
 ##  December 19 2019 fixed a connection check
 ##  Previous updates includes changes to handle Raspbian Buster, RPi4 and other recent changes
     fi
 fi
 
+cd
+curl -s https://getmic.ro | bash
+sudo apt install xclip -qq
+
 sudo rm -rf /var/cache/apt/archives/apt-fast
 sudo apt-get $AQUIET -y clean 2>&1 | tee -a $LOGFILE
 
 #sudo pip install glances 2>&1 | tee -a $LOGFILE
 #sudo pip install bottle 2>&1 | tee -a $LOGFILE
 
-cd
-curl -s https://getmic.ro | bash
-sudo apt install xclip -qq
-
 printstatus "All done."
 printf "${BIGreen}== ${BIYELLOW}When complete, remove the script from the /home/pi directory.\r\n"
 printf "${BIGreen}==\r\n"
Updated by Peter Scargill

File script.sh Modified

  • Ignore whitespace
  • Hide word diff
 ##
-##  "The Script" version May 07, 2020 updates reference to http://tech.scargill.net to the https version, 
-##  improves remote root access and fixes/improves basic web page, removes DarkSky node 
+##  "The Script" version May 11, 2020 updates reference to http://tech.scargill.net to the https version, 
+##  adds "micro" editor, improves remote root access and fixes/improves basic web page, removes DarkSky node 
 ##  December 19 2019 fixed a connection check
 ##  Previous updates includes changes to handle Raspbian Buster, RPi4 and other recent changes
 ##  including the latest Node/Node-Red updates (at this time v1.0.2) on Raspbian 
 ##  NetTools added, Glances and Bottle commented out due to issues with their scripting.
 ##  Also got rid of NPM warnings
 ##
-## To use my own exact setup you will also need: 
-## sudo python -m pip install --upgrade pip setuptools wheel
-## sudo pip install Adafruit-SSD1306
-## my /home/pi/fonts directory (ProggyTiny.ttf) - and sample programs /home/pi/stats.py and 
-## stats32.py - this lot for people who want to run ssd1306 diaplays (32 or 64 px high) in Python rather than install i2c support in Node-Red
+##  To use my own exact setup you will also need: 
+##  sudo python -m pip install --upgrade pip setuptools wheel
+##  sudo pip install Adafruit-SSD1306
+##  my /home/pi/fonts directory (ProggyTiny.ttf) - and sample programs /home/pi/stats.py and 
+##  stats32.py - this lot for people who want to run ssd1306 diaplays (32 or 64 px high) in Python rather than install i2c support in Node-Red
 ##
 ##  "The Script" is the product of years of work and includes (if you select them):
 ##  (Raspberry Pi inc Buster - also tested on Raspbian Stretch Lite - https://downloads.raspberrypi.org/raspbian_lite_latest 
 ##  and the full version works just as well)
 ##  See also: BigTimer, ESP-GO and other included Node-Red nodes of mine
-##  Many thanks to Antonio (Mr Shark) for his work on some of these changes.
 ##
-##  Peter Scargill  https://tech.scargill.net
+##  Many thanks to Antonio (Mr Shark) for his work.
 ##
 ##  Mosquitto (port 1883) with web sockets (Port 9001)
 ##  SQLITE ( xxx.xxx.xxx.xxx/phpliteadmin),
 ##  Apache (xxx.xxx.xxx)
 ##  mpg123
 ##  and Grafana (xxx.xxx.xxx:3000)
-##  also web-page-based software like mc and /phpsysinfo
+##  also web-page-based software like mc, micro and phpsysinfo.
 ##  Grafana defaults to password "password" and offers to let you change it.
 ##
 ## IMPORTANT:-
 ## 5. For Node-Red on Pi Zero,  if the serial port won't connect - look at serial port permissions in /dev/
 ## 6. Do not access this script as SUDO.
 ##
+## INSTALLATION:-
 ## The easiest way to get the script on your machine is:
 ## wget --no-check-certificate  https://bitbucket.org/api/2.0/snippets/scargill/kAR5qG/master/files/script.sh
+## as described here: https://tech.scargill.net/the-script
 ##
 ## For Log2RAM customising see this - https://github.com/azlux/log2ram
 ##
 #sudo pip install glances 2>&1 | tee -a $LOGFILE
 #sudo pip install bottle 2>&1 | tee -a $LOGFILE
 
+cd
+curl -s https://getmic.ro | bash
+sudo apt install xclip -qq
+
 printstatus "All done."
 printf "${BIGreen}== ${BIYELLOW}When complete, remove the script from the /home/pi directory.\r\n"
 printf "${BIGreen}==\r\n"
 echo "alias space='df -h|grep -v udev|grep -v tmpfs|grep -v run'" | sudo tee -a /etc/bash.bashrc > /dev/null 2>&1
 
 
-printstatus  "ALL DONE - PLEASE REBOOT NOW THEN TEST"
+printstatus  "ALL DONE - PLEASE REBOOT NOW THEN TEST"
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.