diff --git a/scripts/a2server-2-tools.txt b/scripts/a2server-2-tools.txt index 2ec0e45..407c5f4 100755 --- a/scripts/a2server-2-tools.txt +++ b/scripts/a2server-2-tools.txt @@ -179,7 +179,7 @@ else echo "A2SERVER: unzip has already been installed." fi -a2sTools="afpsync afptype mkatinit mkvolinfo cppo raspbian-update" +a2sTools="afpsync afptype mkatinit mkvolinfo cppo debupdate" a2sHelp="a2server-help.txt" a2sConfScripts="a2server-aliases a2serverrc" if [[ -z "$a2sDevel" ]]; then diff --git a/scripts/tools/a2server-aliases b/scripts/tools/a2server-aliases index c778627..706e623 100755 --- a/scripts/tools/a2server-aliases +++ b/scripts/tools/a2server-aliases @@ -13,7 +13,6 @@ alias system-restart='sudo shutdown -r now' alias raspi-config='[[ -f /usr/bin/raspi-config ]] && sudo /usr/bin/raspi-config || echo "raspi-config not found. Are you using a Raspberry Pi with Raspbian?"' -alias rasppleii-update='raspbian-update a2cloud a2server' alias welcome-message-edit='sudo nano /etc/motd' diff --git a/scripts/tools/a2server-help.txt b/scripts/tools/a2server-help.txt index 2651001..50148ba 100644 --- a/scripts/tools/a2server-help.txt +++ b/scripts/tools/a2server-help.txt @@ -12,8 +12,7 @@ system-restart: shut down and restart the server Raspberry Pi commands, if you're using one: raspi-config: utilize all space on RPi SD card & other options -raspbian-update : update Raspbian operating system -rasppleii-update : update Raspbian OS, A2CLOUD, A2SERVER, Apple II Pi +debupdate: update the Raspple II operating system welcome-message-edit: change the welcome message diff --git a/scripts/tools/raspbian-update b/scripts/tools/raspbian-update deleted file mode 100755 index fe62708..0000000 --- a/scripts/tools/raspbian-update +++ /dev/null @@ -1,234 +0,0 @@ -#!/bin/bash -# vim: set tabstop=4 shiftwidth=4 noexpandtab filetype=sh: - -# raspbian-update -# updates Raspbian to latest version, including NOOBS if installed - -[[ -f /usr/bin/raspi-config ]] && isRpi=1 || isRpi= - -if [[ ! $isRpi ]]; then - echo "This ain't a Raspberry Pi." - [[ $0 == "-bash" ]] && return 1 || exit 1 -fi - -skipRepoUpdate= -autoYes= -updateA2Cloud= -updateA2Server= -while [[ $1 ]]; do - if [[ $1 == "-r" ]]; then - shift - skipRepoUpdate="-r" - elif [[ $1 == "-y" ]]; then - shift - autoYes="-y" - elif [[ $1 == "-n" ]]; then - shift - noobsOnly="-n" - elif [[ $1 == "a2cloud" ]]; then - shift - updateA2Cloud=1 - elif [[ $1 == "a2server" ]]; then - shift - updateA2Server=1 - elif [[ $1 ]]; then - echo "options:" - echo "-y: auto-answer yes to all prompts and don't prompt for restart" - echo "-r: don't update package repositories" - echo "-n: update NOOBS only; don't update Raspbian" - echo "a2cloud : update A2CLOUD when complete" - echo "a2server: update A2SERVER when complete" - [[ $0 == "-bash" ]] && return 1 || exit 1 - fi -done - -noobs= -readarray -t partitions < <(sudo fdisk -l | grep '^/dev') -if [[ \ - ${partitions[0]:0:14} == "/dev/mmcblk0p1" && ${partitions[0]:57:2} == " e" && - ${partitions[1]:0:14} == "/dev/mmcblk0p2" && ${partitions[1]:57:2} == "85" && - ${partitions[2]:0:14} == "/dev/mmcblk0p3" && ${partitions[2]:57:2} == "83" && - ${partitions[3]:0:14} == "/dev/mmcblk0p5" && ${partitions[3]:57:2} == " c" && - ${partitions[4]:0:14} == "/dev/mmcblk0p6" && ${partitions[4]:57:2} == "83" ]]; then - noobs=" and the NOOBS install manager" -fi - -if [[ ! $autoYes ]]; then - echo - echo "You are about to update your SD card to the latest version of the" - echo "Raspbian operating system${noobs}." - echo - echo "This may take an hour or more, and will require restarting when complete." - echo "You might want a backup before continuing in case it doesn't go as planned." - echo - echo -n "Update Raspbian? " - read - if [[ ${REPLY:0:1} != "Y" && ${REPLY:0:1} != "y" ]]; then - [[ $0 == "-bash" ]] && return 2 || exit 2 - fi -fi - -origDir="$PWD" -cd /tmp - -if [[ ! $skipRepoUpdate ]]; then - echo "Updating package repositories..." - sudo apt-get -y update > /dev/null -else - echo "Not updating package repositories..." - echo -fi - -if [[ ! $noobsOnly ]]; then - { cd /tmp; sudo apt-get -y autoremove; sudo apt-get -y autoclean; sudo apt-get -y clean; } > /dev/null - freeSpace=$(df / | tail -1 | awk '{ print $4 }') - if (( $freeSpace < 400000 )); then - if dpkg -l | grep -q wolfram-engine; then - if [[ ! $autoYes ]]; then - echo "In order to create enough space on your SD card to upgrade," - echo "the Wolfram Language and Mathematica software packages must be removed." - echo "If you don't know what these are, this won't affect you at all." - echo - echo -n "Remove Wolfram software? " - read - if [[ ${REPLY:0:1} != "Y" && ${REPLY:0:1} != "y" ]]; then - [[ $0 == "-bash" ]] && return 2 || exit 2 - fi - sudo rm /opt/Wolfram/WolframEngine/10.0/SystemFiles/Java/Linux-ARM 2> /dev/null - sudo apt-get -y purge wolfram-engine - else - echo "Removing Wolfram software due to space constraints..." - sudo rm /opt/Wolfram/WolframEngine/10.0/SystemFiles/Java/Linux-ARM 2> /dev/null - sudo apt-get -y purge wolfram-engine - fi - else - echo "You don't have enough free space on your SD card to upgrade." - echo "Sorry, man. Delete some stuff or get a bigger card." - [[ $0 == "-bash" ]] && return 1 || exit 1 - fi - fi - - { cd /tmp; sudo apt-get -y autoremove; sudo apt-get -y autoclean; sudo apt-get -y clean; } > /dev/null - dpkg -l | grep -q a2pi && sudo apt-get -y --force-yes install a2pi - dpkg -l | grep -q apple2user && sudo apt-get -y --force-yes install apple2user gsport - if dpkg -l | grep -q wolfram-engine; then - sudo rm /opt/Wolfram/WolframEngine/10.0/SystemFiles/Java/Linux-ARM 2> /dev/null - if [[ $freeSpace -lt 750000 && $(apt-get -s install wolfram-engine | grep upgraded) ]]; then - sudo apt-get -y purge wolfram-engine - { cd /tmp; sudo apt-get -y autoremove; sudo apt-get -y autoclean; sudo apt-get -y clean; } > /dev/null - fi - sudo apt-get -y install wolfram-engine - { cd /tmp; sudo apt-get -y autoremove; sudo apt-get -y autoclean; sudo apt-get -y clean; } > /dev/null - fi - sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade - { cd /tmp; sudo apt-get -y autoremove; sudo apt-get -y autoclean; sudo apt-get -y clean; } > /dev/null - sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade - { cd /tmp; sudo apt-get -y autoremove; sudo apt-get -y autoclean; sudo apt-get -y clean; } > /dev/null - sudo apt-get -y install raspberrypi-ui-mods - { cd /tmp; sudo apt-get -y autoremove; sudo apt-get -y autoclean; sudo apt-get -y clean; } > /dev/null -fi - -if [[ $noobs ]]; then - echo "Updating NOOBS..." - - # update Partition 3 - mkdir -p /tmp/p3 - sudo mount /dev/mmcblk0p3 /tmp/p3 - sudo rm -rf /tmp/p3/os/* 2> /dev/null - if grep -q 'Raspple II' /tmp/p3/installed_os.json; then - echo "Downloading Raspple II lite..." - noobsUrl="ivanx.com/rasppleii/files/RasppleII_lite.zip" - noobsOSurl="ivanx.com/rasppleii/noobs-os" - distDir="Raspple_II" - sudo mkdir -p /tmp/p3/os/$distDir - sudo sed -i 's:/Raspbian:/Raspple_II:' /tmp/p3/installed_os.json - sudo wget -qO /tmp/p3/icon.png $noobsOSurl/Raspple_II.png - { wget -qO- $noobsOSurl/slidesAB.tar | sudo tar -C /tmp/p3/os/$distDir -x; } &> /dev/null - else - echo "Downloading NOOBS lite..." - noobsRoot="downloads.raspberrypi.org/NOOBS_lite/images/" - noobsDir=$(wget -qO- $noobsRoot | grep '^