-## "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
-## including the latest Node/Node-Red updates (at this time v1.0.2) on Raspbian
-## and to use official NR install script on RPi - also fixes to accomodate changed Grafana Repository.
-## 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
+## "The Script" is the product of years of work by me (Peter scargill) and others, in particular Antonio Fragola (Mr Shark)
+## Supports Raspberry Pi with Buster full and lite (not tested NOOBS) - also other boards and op systems see below
-## "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
+## Includes my own Node-Red nodes such as BigTimer.
-## Many thanks to Antonio (Mr Shark) for his help.
+## 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 displays (32 or 64 px high)
+## in Python rather than installing i2c support in Node-Red
-## Mosquitto (port 1883) with web sockets (Port 9001)
-## SQLITE ( xxx.xxx.xxx.xxx/phpliteadmin),
-## Node-Red (xxx.xxx.xxx:1880)
-## Node-Red-Dashboard (xxx.xxx.xxx.xxx:1880/ui)
-## Webmin (xxx.xxx.xxx:10000)
-## and Grafana (xxx.xxx.xxx:3000)
-## also web-page-based software like mc, micro and phpsysinfo.
-## Grafana defaults to password "password" and offers to let you change it.
+## Mosquitto (port 1883) with web sockets (Port 9001)
+## SQLITE ( xxx.xxx.xxx.xxx/phpliteadmin),
+## Node-Red (xxx.xxx.xxx:1880)
+## Node-Red-Dashboard (xxx.xxx.xxx.xxx:1880/ui)
+## Webmin (xxx.xxx.xxx:10000)
+## Apache (xxx.xxx.xxx) (recommend replacing using nginx)
+## Grafana (xxx.xxx.xxx:3000) - defaults to password "password" and offers to let you change it.
+## Web-page-based software like mc, micro and phpsysinfo.
-## 1. Run initially ONLY as ROOT on a non-Raspberry Pi machine (or PI user on Raspberry Pi). If ROOT, PI user will be checked/created for you as the main
+## 1. Run initially ONLY as PI on Raspberry Pi (or ROOT on other hardware). If ROOT, PI user will be checked/created for you as the main
## script must be run as pi.
-## User PI must be in the SUDO group. Other groups are added if needed by the script.
+## User PI must be in the SUDO group (automatic on Raspberry Pi). Other groups are added if needed by the script.
## 2. When selecting GPIO for non-Raspberry Pi devices note - specific support for ODROID C2 only
-## 3. This script could take 3+ hours on a slow Raspberry Pi Zero Wifi.... steer away from midnight to avoid any updates
-## such as dietpi upgrades etc. //recommend NOT using this on Pi Zero as it will be VERY slow.
+## 3. Steer away from midnight to avoid any updates such as dietpi upgrades etc.
+## Recommend NOT using this on Pi Zero as it will be VERY slow.
## 4. For non-Raspberry Pi systems, when asked by Armbian to make a new user - don't bother - the script will do it.
-## 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.
+## 5. Do not access this script as SUDO.
-## 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
+## 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
## See https://tech.scargill.net/orange-pi-pc-battle-of-the-pis/
-## We cannot answer questions on board/operating system combinations we have not tested. See notes below for tested combos.
+## We cannot answer questions on board/operating system combinations we have not tested. See notes below for tested combos and dates.
-## 25/10/2019 I installed all defaults in the script and in addition non-default Grafana onto an ACEPC T9 on which I'd installed the latest Debian Buster
-## Note that Buster on a non-Pi machine may not have SUDO installed by default. To become a super-user to install it if you can't get to root, "su -".
+## 14/05/2020 added in the MICRO editor (not the nightly),
+## removed ha-bridge as it no longer works and there are other ways to control Alexa today
+## 11/05/2020 changed reference to http://tech.scargill.net to the https version,
+## improved remote root access and fixed/improved basic web page, removed DarkSky node
+## 19/12/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 to use official NR install script on RPi - also fixes to accomodate changed Grafana Repository.
+## NetTools added, Glances and Bottle commented out due to issues with their scripting.
+## Also got rid of NPM warnings
+## 25/10/2019 Installed all defaults in the script and in addition non-default Grafana onto an ACEPC T9 on which I'd installed the latest Debian Buster
+## Note that Buster on a non-Pi machine may not have SUDO installed by default. To become a super-user to install it if you can't get to root, "su -".
## 01/07/2019 used 3-liner as in the blog to upgrade an RPI which had been set up initially using the script in Stretch - to Buster.
## 17/02/2019 Added pure-ftp
## 07/02/2019 Separated NR into official NR install script, added tcpdump - not added fing but worth doing?
## FriendlyArm's WiringPi i2c is currently bust)
## 18/08/2017 Modified to handle latest Raspbian Stretch - tested on RPI3
## 10/08/2017 Added "nrlog" utility for viewing and "tailing" - i.e. monitoring node-red logs in colour in
## 10/08/2017 Tested RPI3 - turns out the new GPIO nodes work perfectly on that - as does i2c
-## - commenting out the RPI contrib GPIO as it needs ROOT permissions!!!!!
-## see https://tech.scargill.net/the-real-raspberry-pi/
+## - commenting out the RPI contrib GPIO as it needs ROOT permissions!!!!!
+## see https://tech.scargill.net/the-real-raspberry-pi/
## 29/07/2017 Added rule to help node-red-contrib-opi-gpio utility with various boards using GPIO. See docs
-## for that node - very promising - tried various nano boards with success
+## for that node - very promising - tried various nano boards with success
## 24/07/2017 Tested on the new NanoPi Neo Plus2 - worked a treat - I2c running - lovely
## 24/07/2017 Tested on a Raspberry Pi 2 using current Jessie
## 24/07/2017 Tested NanoPi Neo Air using Ubuntu Core Xenial 4.11.2
## 04/07/2017 OrangePi Plus 2 - thanks to blog reader RoyG for that
## 26/12/2016 - complete re-hash for new menus
## 02/12/2016 Tested Roseapple Pi using Armbian - for Node-Red serial, had to
-## enable permissions for the serial - everything worked first time
+## enable permissions for the serial - everything worked first time
## 16/05/2016 Tested on NanoPi M1 - (got 3 UARTS out of the M1)
## 22/06/2016 tested on NanoPi NEO using Armbian Jessie Server
## 28/12/2016 tested in DietPi and Xenial virtual machines
-## http://www.armbian.com/donate/?f=Armbian_5.20_Nanopineo_Debian_jessie_3.4.112.7z
+## http://www.armbian.com/donate/?f=Armbian_5.20_Nanopineo_Debian_jessie_3.4.112.7z
## NOTE:- removed node-red-contrib-admin from Node-red setup as you can now do installs in the palette manager
## you could run the file as ./script.sh
-## Note- on the Odroid C2, everything installed except Webmin. After reboot this is what I did to get it running..
+## Note:- on the Odroid C2, everything installed except Webmin. After reboot this is what I did to get it running..
## wget http://prdownloads.sourceforge.net/webadmin/webmin_1.850_all.deb
## sudo dpkg --install webmin_1.850_all.deb
## That complained about missing bits so I used...
## That installed the lot - working - something to do with it being 64 bits - but it works -
## pi or root user and password and https://whatever:10000
-## Thanks for contributions from Antonio Fragola, Aidan Ruff and others. Thank you.
## Node-Red security added as standard - using the ADMIN login. MQTT also has same ADMIN login.
-## Here at the beginning, a load of useful routines - see further down
# Get time as a UNIX timestamp (seconds elapsed since Jan 1, 1970 0:00 UTC)
-# user pi existance/creation
+# user pi existence/creation for non-Raspberry Pi hardware
echo -e USER: $USER >> $LOGFILE
if [[ $USER != "pi" ]]; then
if [[ $USER == "root" ]]; then
"passwords" "Update ROOT and PI user passwords" 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)
MYMENU=$(whiptail --title "Peter Scargill's 'The Script' Main Non-Pi Menu" --checklist \
-printstatus "COMPLETE - PLEASE REBOOT NOW THEN TEST"
+printstatus "COMPLETE - REBOOT NOW"