From cd8271cd56fdbe9236b98e0cdddca563a9a452be Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Fri, 29 Jan 2016 04:22:54 -0800 Subject: [PATCH 1/4] setup/index.txt: Print version once A minor thing, but reducing slightly duplicated code is always a good thing, and printing the version number is never a bad idea. --- setup/index.txt | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/setup/index.txt b/setup/index.txt index 94113f4..2d72127 100755 --- a/setup/index.txt +++ b/setup/index.txt @@ -29,10 +29,11 @@ isRpi= isDebian= lsb_release -a 2> /dev/null | grep -q 'Distributor ID:.Debian' && [[ ( -f /etc/debian_version ) && ( $(cut -c 1 < /etc/debian_version) -ge "7" ) ]] && isDebian=1 -if [[ -f /usr/local/etc/A2SERVER-version ]]; then - echo "A2SERVER version available: $a2serverVersion" - echo "A2SERVER version installed: $(cat /usr/local/etc/A2SERVER-version)" +if [ -f /usr/local/etc/A2SERVER-version ]; then + installedVersion="$(cat /usr/local/etc/A2SERVER-version)" fi +echo "A2SERVER version available: $a2serverVersion" +echo "A2SERVER version installed: ${installedVersion:=None}" echo [[ $scriptURL != *"ivanx.com"* && $scriptURL != *"rawgit.com/RasppleII/a2server"* ]] && echo "Using script URL: $scriptURL" @@ -77,10 +78,7 @@ while [[ $1 ]]; do updateRasppleII=1 elif [[ $1 == "-v" ]]; then shift - if [[ ! -f /usr/local/etc/A2SERVER-version ]]; then - echo "A2SERVER version available: $a2serverVersion" - echo "A2SERVER version installed: none" - fi + # Version was already printed [[ $0 == "-bash" ]] && return 1 || exit 1 elif [[ $1 ]]; then echo "options:" From cd205709993f7285cedf3345135301c2dcb75c3c Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Sat, 30 Jan 2016 03:25:27 -0800 Subject: [PATCH 2/4] *.txt: Fix Debian wheezy/jessie version checks Found some checks that assumed all Debian was wheezy, and also a bunch of use of cut assuming that there will never be a Debian version higher than 9.0. Let's just futureproof that code right now. This closes #56 and uses the method described therein anywhere -c 1 is used now. For the checks against -c 1-2, we still use -d . -f 1 as described in the issue, but modify the following conditionals to test for just the numeric, without the decimal. --- scripts/a2server-2-tools.txt | 8 ++++---- scripts/a2server-3-sharing.txt | 8 ++++---- scripts/a2server-7-console.txt | 2 +- setup/index.txt | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/a2server-2-tools.txt b/scripts/a2server-2-tools.txt index b0c6316..ef3981b 100755 --- a/scripts/a2server-2-tools.txt +++ b/scripts/a2server-2-tools.txt @@ -22,7 +22,7 @@ arch= if [[ -f /usr/bin/raspi-config ]]; then isRpi=1 arch='rpi' -elif lsb_release -a 2> /dev/null | grep -q 'Distributor ID:.Debian' && [[ $(cut -c 1 <<< $debianVersion) -ge "7" ]]; then +elif lsb_release -a 2> /dev/null | grep -q 'Distributor ID:.Debian' && [[ $(cut -d . -f 1 <<< $debianVersion) -ge "7" ]]; then uname_m="$(uname -m)" if [[ $uname_m == "i686" ]]; then arch='debian_x86' @@ -33,10 +33,10 @@ fi debianName= if [[ $debianVersion ]]; then - debianMajor=$(cut -c 1-2 <<< $debianVersion) - if [[ $debianMajor == "8." ]]; then + debianMajor=$(cut -d . -f 1 <<< $debianVersion) + if [[ $debianMajor == "8" ]]; then debianName="jessie" - elif [[ $debianMajor == "7." ]]; then + elif [[ $debianMajor == "7" ]]; then debianName="wheezy" else debianName="unknown" diff --git a/scripts/a2server-3-sharing.txt b/scripts/a2server-3-sharing.txt index d6645cc..f992cb9 100755 --- a/scripts/a2server-3-sharing.txt +++ b/scripts/a2server-3-sharing.txt @@ -32,7 +32,7 @@ arch= if [[ -f /usr/bin/raspi-config ]]; then isRpi=1 arch='rpi' -elif lsb_release -a 2> /dev/null | grep -q 'Distributor ID:.Debian' && [[ $(cut -c 1 <<< $debianVersion) -ge "7" ]]; then +elif lsb_release -a 2> /dev/null | grep -q 'Distributor ID:.Debian' && [[ $(cut -d . -f 1 <<< $debianVersion) -ge "7" ]]; then uname_m="$(uname -m)" if [[ $uname_m == "i686" ]]; then arch='debian_x86' @@ -43,10 +43,10 @@ fi debianName= if [[ $debianVersion ]]; then - debianMajor=$(cut -c 1-2 <<< $debianVersion) - if [[ $debianMajor == "8." ]]; then + debianMajor=$(cut -d . -f 1 <<< $debianVersion) + if [[ $debianMajor == "8" ]]; then debianName="jessie" - elif [[ $debianMajor == "7." ]]; then + elif [[ $debianMajor == "7" ]]; then debianName="wheezy" else debianName="unknown" diff --git a/scripts/a2server-7-console.txt b/scripts/a2server-7-console.txt index f7242a1..25e72b2 100755 --- a/scripts/a2server-7-console.txt +++ b/scripts/a2server-7-console.txt @@ -14,7 +14,7 @@ password="your password" [[ $isRaspberryPw ]] && password="'raspberry'" isDebian= -[[ ( -f /etc/debian_version ) && ( $(cut -c 1-2 < /etc/debian_version) == "7." ) && ( $(uname -m) == "i686" ) ]] && isDebian=1 +b_release -a 2> /dev/null | grep -q 'Distributor ID:.Debian' && [[ ( -f /etc/debian_version ) && ( $(cut -d . -f 1 < /etc/debian_version) -ge "7" ) ]] && isDebian=1 if [[ $isDebian ]]; then if { lspci 2> /dev/null | grep -q VirtualBox; }; then diff --git a/setup/index.txt b/setup/index.txt index 2d72127..809a5d2 100755 --- a/setup/index.txt +++ b/setup/index.txt @@ -27,7 +27,7 @@ isRpi= [[ -f /usr/bin/raspi-config ]] && isRpi=1 isDebian= -lsb_release -a 2> /dev/null | grep -q 'Distributor ID:.Debian' && [[ ( -f /etc/debian_version ) && ( $(cut -c 1 < /etc/debian_version) -ge "7" ) ]] && isDebian=1 +lsb_release -a 2> /dev/null | grep -q 'Distributor ID:.Debian' && [[ ( -f /etc/debian_version ) && ( $(cut -d . -f 1 < /etc/debian_version) -ge "7" ) ]] && isDebian=1 if [ -f /usr/local/etc/A2SERVER-version ]; then installedVersion="$(cat /usr/local/etc/A2SERVER-version)" From d86e3bfa8883ef0efcbd7bff99acf6631c0ac10b Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Sat, 30 Jan 2016 15:27:33 -0800 Subject: [PATCH 3/4] 5-netboot: Guidance on choosing GS/OS version Closes #45. --- scripts/a2server-5-netboot.txt | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/a2server-5-netboot.txt b/scripts/a2server-5-netboot.txt index a9b6699..61c156b 100755 --- a/scripts/a2server-5-netboot.txt +++ b/scripts/a2server-5-netboot.txt @@ -340,11 +340,22 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then if [[ $gsosReinstall ]]; then if [[ ! $autoAnswerYes ]]; then + echo echo "You can set up GS/OS for network boot. This may take a while." - echo "0: don't install GS/OS" - echo "1: GS/OS 6.0.1 (official Apple release, May 1993)" - echo "2: GS/OS 6.0.2 (community release by Antoine Vignau, July 2015)" - echo "3: GS/OS 6.0.3 (community release by Tony Diaz, August 2015)" + echo + echo " 0: don't install GS/OS" + echo " 1: GS/OS 6.0.1 (May 1993) [official release]" + echo " The final version authorized by Apple. It has a few bugs," + echo " but most of these can be patched. Predictable and might be" + echo " required if you use certain patches." + echo " 2: GS/OS 6.0.2 (Jul 2015)" + echo " A community effort released by Antoine Vignau with fixes for" + echo " some serious bugs and a few other enhancements." + echo " 3: GS/OS 6.0.3 (Aug 2015)" + echo " Continuing community effort released by Tony Diaz. Includes" + echo " previous work along with additional fixes/changes. Better" + echo " documentation of changes. Most will prefer this or Apple's" + echo " release above." echo echo -n "Which flavor would you like? " read From dfa1e26c80f988f3f7bc1f5275ac9108a50cac97 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Mon, 15 Feb 2016 03:52:32 -0800 Subject: [PATCH 4/4] README.md: code spans to avoid _ errors Put a couple of filenames in code spans so that _ characters in them would not turn on unwanted in HTML. This is something GitHub's Markdown markup doesn't do because it's almost never what you want, but everything else does because that's what John Gruber designed. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6690106..ff19798 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Once you have those: export A2SERVER_NO_EXTERNAL=1 ~~~ -You may want to put the above exports into ~/.bashrc or ~/.bash_profile. +You may want to put the above exports into `~/.bashrc` or `~/.bash_profile`. If you want to host scripts locally installed on your own machine or another computer on your LAN, type the following, and export "http://localhost:8000/"