From 888239238359fb662644eab99c0fa75f8b7d79eb Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Sun, 4 Oct 2015 00:12:32 -0700 Subject: [PATCH 01/11] Make scripts executable, add shebang lines --- scripts/a2server-1-storage.txt | 0 scripts/a2server-2-tools.txt | 0 scripts/a2server-3-sharing.txt | 0 scripts/a2server-5-netboot.txt | 0 scripts/a2server-6-samba.txt | 0 scripts/a2server-7-console.txt | 0 setup.sh | 2 ++ update.sh | 2 ++ 8 files changed, 4 insertions(+) mode change 100644 => 100755 scripts/a2server-1-storage.txt mode change 100644 => 100755 scripts/a2server-2-tools.txt mode change 100644 => 100755 scripts/a2server-3-sharing.txt mode change 100644 => 100755 scripts/a2server-5-netboot.txt mode change 100644 => 100755 scripts/a2server-6-samba.txt mode change 100644 => 100755 scripts/a2server-7-console.txt mode change 100644 => 100755 setup.sh mode change 100644 => 100755 update.sh diff --git a/scripts/a2server-1-storage.txt b/scripts/a2server-1-storage.txt old mode 100644 new mode 100755 diff --git a/scripts/a2server-2-tools.txt b/scripts/a2server-2-tools.txt old mode 100644 new mode 100755 diff --git a/scripts/a2server-3-sharing.txt b/scripts/a2server-3-sharing.txt old mode 100644 new mode 100755 diff --git a/scripts/a2server-5-netboot.txt b/scripts/a2server-5-netboot.txt old mode 100644 new mode 100755 diff --git a/scripts/a2server-6-samba.txt b/scripts/a2server-6-samba.txt old mode 100644 new mode 100755 diff --git a/scripts/a2server-7-console.txt b/scripts/a2server-7-console.txt old mode 100644 new mode 100755 diff --git a/setup.sh b/setup.sh old mode 100644 new mode 100755 index ef81aac..cd89af3 --- a/setup.sh +++ b/setup.sh @@ -1,3 +1,5 @@ +#! /bin/bash + # A2SERVER master setup script, last update 15-Feb-2015 # it downloads and executes several scripts related to the setup of # netatalk configured for Apple II use on Debian, Raspbian, or Ubuntu. diff --git a/update.sh b/update.sh old mode 100644 new mode 100755 index bb67ca4..b8dd2d8 --- a/update.sh +++ b/update.sh @@ -1,3 +1,5 @@ +#! /bin/bash + currentVersion=124 if [[ -f /usr/local/etc/A2SERVER-version ]]; then From 982836dc7c2b0a5ec8df211ee7f766e9a8e4126b Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Sun, 4 Oct 2015 01:23:53 -0700 Subject: [PATCH 02/11] A2SERVER_SCRIPT_URL variable added Added shell variable A2SERVER_SCRIPT_URL which allows you to replace Ivan's server with another URL for development. If unset, scripts will default to "http://appleii.ivanx.com/a2server/" as usual. This will not allow you to use these scripts for development directly, and in fact may have been over-zealous in removing hardcoded ivanx links. Also, Ivan's webserver has a slightly different layout than this repository because I haven't tried to make this an apache directory structure full of mixed HTML, scripts, .htaccess files, etc. --- scripts/a2server-2-tools.txt | 28 +++++++++++++++++----------- scripts/a2server-3-sharing.txt | 14 ++++++++++---- scripts/a2server-5-netboot.txt | 16 +++++++++++----- setup.sh | 20 +++++++++++++------- update.sh | 10 ++++++++-- 5 files changed, 59 insertions(+), 29 deletions(-) diff --git a/scripts/a2server-2-tools.txt b/scripts/a2server-2-tools.txt index 638ecdf..f1e30e4 100755 --- a/scripts/a2server-2-tools.txt +++ b/scripts/a2server-2-tools.txt @@ -3,6 +3,12 @@ # download and install a2server tools: # mkatinit, mkvolinfo, afptype, afpsync, aliases, nulib2 +# Ensure URL we'll use ends in a / +case "$A2SERVER_SCRIPT_URL" in + */) scriptURL="$A2SERVER_SCRIPT_URL" ;; + *) scriptURL="${A2SERVER_SCRIPT_URL:-http://appleii.ivanx.com/a2server}/" ;; +esac + isRpi= [[ -f /usr/bin/raspi-config ]] && isRpi=1 @@ -17,9 +23,9 @@ if [[ ! -f /usr/local/bin/nulib2 ]]; then cd /tmp if [[ $isRpi ]]; then - wget -qO- ivanx.com/a2server/files/nulib2-rpi.tgz | sudo tar Pzx + wget -qO- "${scriptURL}files/nulib2-rpi.tgz" | sudo tar Pzx elif [[ $isDebian ]]; then - wget -qO- ivanx.com/a2server/files/nulib2-debian7_x86.tgz | sudo tar Pzx + wget -qO- "${scriptURL}files/nulib2-debian7_x86.tgz" | sudo tar Pzx fi if [[ ! -f /usr/local/bin/nulib2 ]]; then @@ -72,9 +78,9 @@ if [[ ! -f /usr/local/bin/unar ]]; then sudo apt-get -y install libgnustep-base1.22 sudo apt-get clean if [[ $isRpi ]]; then - wget -qO- ivanx.com/a2server/files/unar-rpi.tgz | sudo tar Pzx + wget -qO- "${scriptURL}files/unar-rpi.tgz" | sudo tar Pzx elif [[ $isDebian ]]; then - wget -qO- ivanx.com/a2server/files/unar-debian7_x86.tgz | sudo tar Pzx + wget -qO- "${scriptURL}files/unar-debian7_x86.tgz" | sudo tar Pzx fi fi if [[ ! -f /usr/local/bin/unar ]]; then @@ -100,18 +106,18 @@ else echo "A2SERVER: The Unarchiver has already been installed." fi -sudo wget -q -O /usr/local/bin/afpsync appleii.ivanx.com/a2server/scripts/tools/afpsync.txt +sudo wget -q -O /usr/local/bin/afpsync "${scriptURL}scripts/tools/afpsync.txt" sudo chmod ugo+x /usr/local/bin/afpsync -sudo wget -q -O /usr/local/bin/afptype appleii.ivanx.com/a2server/scripts/tools/afptype.txt +sudo wget -q -O /usr/local/bin/afptype "${scriptURL}scripts/tools/afptype.txt" sudo chmod ugo+x /usr/local/bin/afptype -sudo wget -q -O /usr/local/bin/mkatinit appleii.ivanx.com/a2server/scripts/tools/mkatinit.txt +sudo wget -q -O /usr/local/bin/mkatinit "${scriptURL}scripts/tools/mkatinit.txt" sudo chmod ugo+x /usr/local/bin/mkatinit -sudo wget -q -O /usr/local/bin/mkvolinfo appleii.ivanx.com/a2server/scripts/tools/mkvolinfo.txt +sudo wget -q -O /usr/local/bin/mkvolinfo "${scriptURL}scripts/tools/mkvolinfo.txt" sudo chmod ugo+x /usr/local/bin/mkvolinfo -sudo wget -q -O /usr/local/bin/cppo appleii.ivanx.com/a2server/scripts/tools/cppo.txt +sudo wget -q -O /usr/local/bin/cppo "${scriptURL}scripts/tools/cppo.txt" sudo chmod ugo+x /usr/local/bin/cppo -sudo wget -q -O /usr/local/etc/a2server-help.txt appleii.ivanx.com/a2server/scripts/tools/a2server-help.txt -sudo wget -q -O /usr/local/etc/a2server-aliases appleii.ivanx.com/a2server/scripts/tools/a2server-aliases.txt +sudo wget -q -O /usr/local/etc/a2server-help.txt "${scriptURL}scripts/tools/a2server-help.txt" +sudo wget -q -O /usr/local/etc/a2server-aliases "${scriptURL}scripts/tools/a2server-aliases.txt" grep a2server-aliases /etc/bash.bashrc > /dev/null || \ echo "source /usr/local/etc/a2server-aliases" | sudo tee -a /etc/bash.bashrc > /dev/null diff --git a/scripts/a2server-3-sharing.txt b/scripts/a2server-3-sharing.txt index 79f3a37..3e710a5 100755 --- a/scripts/a2server-3-sharing.txt +++ b/scripts/a2server-3-sharing.txt @@ -18,6 +18,12 @@ # --- Installing netatalk +# Ensure URL we'll use ends in a / +case "$A2SERVER_SCRIPT_URL" in + */) scriptURL="$A2SERVER_SCRIPT_URL" ;; + *) scriptURL="${A2SERVER_SCRIPT_URL:-http://appleii.ivanx.com/a2server}/" ;; +esac + isRpi= [[ -f /usr/bin/raspi-config ]] && isRpi=1 @@ -67,9 +73,9 @@ else # install Netatalk if [[ $isRpi ]]; then - { wget -qO- /tmp/netatalk.tgz ivanx.com/a2server/files/netatalk224-rpi.tgz | sudo tar Pzx; } 2> /dev/null + { wget -qO- /tmp/netatalk.tgz ${scriptURL}files/netatalk224-rpi.tgz | sudo tar Pzx; } 2> /dev/null elif [[ $isDebian ]]; then - { wget -qO- /tmp/netatalk.tgz ivanx.com/a2server/files/netatalk224-debian7_x86.tgz | sudo tar Pzx; } 2> /dev/null + { wget -qO- /tmp/netatalk.tgz ${scriptURL}files/netatalk224-debian7_x86.tgz | sudo tar Pzx; } 2> /dev/null fi sudo mandb &> /dev/null @@ -132,7 +138,7 @@ echo "A2SERVER: Configuring Netatalk..." # if missing Netatalk startup file, download a fresh one if [ ! -f /etc/init.d/netatalk ]; then echo "A2SERVER: Downloading new Netatalk startup script..." - sudo wget -qO /etc/init.d/netatalk ivanx.com/a2server/files/netatalk-init.d-clean.txt + sudo wget -qO /etc/init.d/netatalk ${scriptURL}files/netatalk-init.d-clean.txt fi # make the Netatalk startup script work correctly @@ -333,7 +339,7 @@ if [[ ( ! $(ps aux | grep [a]talkd) ) && ( $isRpi ) ]]; then # if no AppleTalk module, try to download it from a2server site if [[ ! -f /lib/modules/$kernelRelease/kernel/net/appletalk/appletalk.ko ]]; then # check for rpi kernel module echo "A2SERVER: Attempting to install AppleTalk kernel module for Raspbian..." - wget -qO /tmp/appletalk.ko.gz appleii.ivanx.com/a2server/files/appletalk-$kernelRelease.ko.gz + wget -qO /tmp/appletalk.ko.gz ${scriptURL}files/appletalk-$kernelRelease.ko.gz if [[ $? -eq 0 ]]; then # if we found a prebuilt one on a2server site, install it and load it gunzip -f /tmp/appletalk.ko.gz diff --git a/scripts/a2server-5-netboot.txt b/scripts/a2server-5-netboot.txt index 87b68b5..4ef464e 100755 --- a/scripts/a2server-5-netboot.txt +++ b/scripts/a2server-5-netboot.txt @@ -6,6 +6,12 @@ # program (for Apple IIe users, and IIgs users in ProDOS network mode). # It also can download and install GS/OS for a network boot configuration. +# Ensure URL we'll use ends in a / +case "$A2SERVER_SCRIPT_URL" in + */) scriptURL="$A2SERVER_SCRIPT_URL" ;; + *) scriptURL="${A2SERVER_SCRIPT_URL:-http://ivanx.com/a2server}/" ;; +esac + gsosDir="/media/A2SHARED/A2FILES" imagesDir=$gsosDir/GSOS.INSTALLER/IMAGES imageToolsDir=$gsosDir/GSOS.INSTALLER/IMAGE.TOOLS @@ -81,7 +87,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then || [[ ! -f /usr/local/bin/mkvolinfo ]] \ || [[ ! -f /usr/local/bin/afpsync ]]; then rm /tmp/2.tools &> /dev/null - wget -q -O /tmp/2.tools appleii.ivanx.com/a2server/scripts/a2server-2-tools.txt + wget -q -O /tmp/2.tools "${scriptURL}scripts/a2server-2-tools.txt" chmod ugo+x /tmp/2.tools /tmp/2.tools rm /tmp/2.tools @@ -294,7 +300,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then echo cd /tmp/netboot wget -qO shrinkit.sdk http://web.archive.org/web/20131031160750/http://www.nulib.com/library/shrinkit.sdk - [[ ! -f shrinkit.sdk ]] && wget -qO shrinkit.sdk appleii.ivanx.com/a2server/files/shrinkit.sdk + [[ ! -f shrinkit.sdk ]] && wget -qO shrinkit.sdk "${scriptURL}files/shrinkit.sdk" nulib2 -xs shrinkit.sdk > /dev/null cppo -s -ad SHRINKIT /SHRINKIT/SHRINKIT $diskToolsP8Dir 2> /dev/null afpsync -v $sharepath > /dev/null @@ -371,7 +377,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then mkdir -p $zlinkDir/.AppleDouble echo cd /tmp/netboot - wget -qO A2CLOUD.HDV http://ivanx.com/a2cloud/files/A2CLOUD.HDV + wget -qO A2CLOUD.HDV "${scriptURL}files/A2CLOUD.HDV" cppo -ad A2CLOUD.HDV . > /dev/null cd A2CLOUD mv *PT3* *PROTERM* $protermDir @@ -423,7 +429,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then fi if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then echo "A2SERVER: Downloading Farallon bridge patch..." - wget -O /tmp/FARALLON.PO appleii.ivanx.com/a2server/files/FARALLON.B1.PO &> /dev/null + wget -O /tmp/FARALLON.PO "${scriptURL}files/FARALLON.B1.PO" &> /dev/null if [[ -d $gsosDir/SYSTEM/SYSTEM.SETUP ]]; then cppo -s -ad /tmp/FARALLON.PO /ATALKPATCH/ATALKIRQ $gsosDir/SYSTEM/SYSTEM.SETUP &> /dev/null echo @@ -441,4 +447,4 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then echo "directly into ProDOS 8 will freeze after a few minutes." fi -fi \ No newline at end of file +fi diff --git a/setup.sh b/setup.sh index cd89af3..9223c23 100755 --- a/setup.sh +++ b/setup.sh @@ -10,6 +10,12 @@ a2serverVersion="124" +# Ensure URL we'll use ends in a / +case "$A2SERVER_SCRIPT_URL" in + */) scriptURL="$A2SERVER_SCRIPT_URL" ;; + *) scriptURL="${A2SERVER_SCRIPT_URL:-http://appleii.ivanx.com/a2server}/" ;; +esac + isRpi= [[ -f /usr/bin/raspi-config ]] && isRpi=1 @@ -70,7 +76,7 @@ done if [[ $updateRasppleII ]]; then echo "A2SERVER: Updating Raspple II (takes up to an hour)..." - wget -qO /tmp/raspbian-update ivanx.com/a2server/files/raspbian-update.txt + wget -qO /tmp/raspbian-update "${scriptURL}files/raspbian-update.txt" source /tmp/raspbian-update a2cloud a2server $autoAnswerYes $skipRepoUpdate [[ $0 == "-bash" ]] && return 0 || exit 0 fi @@ -167,22 +173,22 @@ if (( $doSetup )); then echo echo "A2SERVER: Downloading scripts..." - wget -q -O /tmp/1.storage appleii.ivanx.com/a2server/scripts/a2server-1-storage.txt + wget -q -O /tmp/1.storage "${scriptURL}scripts/a2server-1-storage.txt" chmod ugo+x /tmp/1.storage - wget -q -O /tmp/2.tools appleii.ivanx.com/a2server/scripts/a2server-2-tools.txt + wget -q -O /tmp/2.tools "${scriptURL}scripts/a2server-2-tools.txt" chmod ugo+x /tmp/2.tools - wget -q -O /tmp/3.sharing appleii.ivanx.com/a2server/scripts/a2server-3-sharing.txt + wget -q -O /tmp/3.sharing "${scriptURL}scripts/a2server-3-sharing.txt" chmod ugo+x /tmp/3.sharing - wget -q -O /tmp/5.netboot appleii.ivanx.com/a2server/scripts/a2server-5-netboot.txt + wget -q -O /tmp/5.netboot "${scriptURL}scripts/a2server-5-netboot.txt" chmod ugo+x /tmp/5.netboot - wget -q -O /tmp/6.samba appleii.ivanx.com/a2server/scripts/a2server-6-samba.txt + wget -q -O /tmp/6.samba "${scriptURL}scripts/a2server-6-samba.txt" chmod ugo+x /tmp/6.samba - wget -q -O /tmp/7.console appleii.ivanx.com/a2server/scripts/a2server-7-console.txt + wget -q -O /tmp/7.console "${scriptURL}scripts/a2server-7-console.txt" chmod ugo+x /tmp/7.console echo "A2SERVER: Scripts have been downloaded. Installing..." diff --git a/update.sh b/update.sh index b8dd2d8..f2e2d3d 100755 --- a/update.sh +++ b/update.sh @@ -8,6 +8,12 @@ else installedVersion=100 fi +# Ensure URL we'll use ends in a / +case "$A2SERVER_SCRIPT_URL" in + */) scriptURL="$A2SERVER_SCRIPT_URL" ;; + *) scriptURL="${A2SERVER_SCRIPT_URL:-http://appleii.ivanx.com/a2server}/" ;; +esac + autoAnswerYes= for arg in $@; do if [[ $arg == "-y" ]]; then @@ -18,7 +24,7 @@ done echo echo "Update history:" -wget -qO- appleii.ivanx.com/a2server/update/versionhistory.txt +wget -qO- "${scriptURL}update/versionhistory.txt" echo echo "installed version: ${installedVersion:0:1}.${installedVersion:1:1}.${installedVersion:2:1}" echo "current version: ${currentVersion:0:1}.${currentVersion:1:1}.${currentVersion:2:1}" @@ -32,7 +38,7 @@ fi if [[ ${REPLY:0:1} == "y" || ${REPLY:0:1} == "Y" ]]; then sudo rm /usr/local/etc/A2SERVER-version &> /dev/null # sudo rm /usr/local/etc/netatalk/a2boot/* &> /dev/null - wget -q -O /tmp/setup appleii.ivanx.com/a2server/setup; source /tmp/setup "$@" + wget -q -O /tmp/setup "${scriptURL}setup"; source /tmp/setup "$@" fi unset currentVersion 2> /dev/null From ff2da76e846115d9927b41920e62b3d0d62f7c11 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Sun, 4 Oct 2015 02:04:52 -0700 Subject: [PATCH 03/11] Get Ivan's precompiled binaries from his server Ivan's precompiled binaries of nulib2, The Unarchiver, and netatalk for Debian and Raspbian aren't going to be part of this repository, so I've reverted to hardcoding Ivan's server as the source of those things. We could perhaps download and compile nulib2 and The Unarchiver, and we'd have to if the script doesn't recognize Debian/Raspbian. Ideally for those systems we'd download .deb packages with full and proper dependency tracking, but we'd still need source for use on non-Debian systems, should we ever develop support for those. (OS X is a good candidate for such a system?) --- scripts/a2server-2-tools.txt | 8 ++++---- scripts/a2server-3-sharing.txt | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/a2server-2-tools.txt b/scripts/a2server-2-tools.txt index f1e30e4..1930ebc 100755 --- a/scripts/a2server-2-tools.txt +++ b/scripts/a2server-2-tools.txt @@ -23,9 +23,9 @@ if [[ ! -f /usr/local/bin/nulib2 ]]; then cd /tmp if [[ $isRpi ]]; then - wget -qO- "${scriptURL}files/nulib2-rpi.tgz" | sudo tar Pzx + wget -qO- "http://appleii.ivanx.com/a2server/files/nulib2-rpi.tgz" | sudo tar Pzx elif [[ $isDebian ]]; then - wget -qO- "${scriptURL}files/nulib2-debian7_x86.tgz" | sudo tar Pzx + wget -qO- "http://appleii.ivanx.com/a2server/files/nulib2-debian7_x86.tgz" | sudo tar Pzx fi if [[ ! -f /usr/local/bin/nulib2 ]]; then @@ -78,9 +78,9 @@ if [[ ! -f /usr/local/bin/unar ]]; then sudo apt-get -y install libgnustep-base1.22 sudo apt-get clean if [[ $isRpi ]]; then - wget -qO- "${scriptURL}files/unar-rpi.tgz" | sudo tar Pzx + wget -qO- "http://appleii.ivanx.com/a2server/files/unar-rpi.tgz" | sudo tar Pzx elif [[ $isDebian ]]; then - wget -qO- "${scriptURL}files/unar-debian7_x86.tgz" | sudo tar Pzx + wget -qO- "http://appleii.ivanx.com/a2server/files/unar-debian7_x86.tgz" | sudo tar Pzx fi fi if [[ ! -f /usr/local/bin/unar ]]; then diff --git a/scripts/a2server-3-sharing.txt b/scripts/a2server-3-sharing.txt index 3e710a5..21c545c 100755 --- a/scripts/a2server-3-sharing.txt +++ b/scripts/a2server-3-sharing.txt @@ -73,9 +73,9 @@ else # install Netatalk if [[ $isRpi ]]; then - { wget -qO- /tmp/netatalk.tgz ${scriptURL}files/netatalk224-rpi.tgz | sudo tar Pzx; } 2> /dev/null + { wget -qO- /tmp/netatalk.tgz "http://appleii.ivanx.com/a2server/files/netatalk224-rpi.tgz" | sudo tar Pzx; } 2> /dev/null elif [[ $isDebian ]]; then - { wget -qO- /tmp/netatalk.tgz ${scriptURL}files/netatalk224-debian7_x86.tgz | sudo tar Pzx; } 2> /dev/null + { wget -qO- /tmp/netatalk.tgz "http://appleii.ivanx.com/a2server/files/netatalk224-debian7_x86.tgz" | sudo tar Pzx; } 2> /dev/null fi sudo mandb &> /dev/null From 224a9b0005300c6cc1e8e17655fb9da85d3864e4 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Sun, 4 Oct 2015 02:27:30 -0700 Subject: [PATCH 04/11] Make all scripts executable --- scripts/afpsync.txt | 0 scripts/afptype.txt | 0 scripts/cppo.txt | 0 scripts/mkatinit.txt | 0 scripts/mkvolinfo.txt | 0 5 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/afpsync.txt mode change 100644 => 100755 scripts/afptype.txt mode change 100644 => 100755 scripts/cppo.txt mode change 100644 => 100755 scripts/mkatinit.txt mode change 100644 => 100755 scripts/mkvolinfo.txt diff --git a/scripts/afpsync.txt b/scripts/afpsync.txt old mode 100644 new mode 100755 diff --git a/scripts/afptype.txt b/scripts/afptype.txt old mode 100644 new mode 100755 diff --git a/scripts/cppo.txt b/scripts/cppo.txt old mode 100644 new mode 100755 diff --git a/scripts/mkatinit.txt b/scripts/mkatinit.txt old mode 100644 new mode 100755 diff --git a/scripts/mkvolinfo.txt b/scripts/mkvolinfo.txt old mode 100644 new mode 100755 From e216e5fbe30198fe87ee9e57b9db6c2f179f457d Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Sun, 4 Oct 2015 07:31:11 -0700 Subject: [PATCH 05/11] Change mode for a2server-help.txt to 644 Turns out a2server-help isn't actually a script, it's actually a text file which is more'd by an alias of the same name. We could cleverly replace that alias with a very clever shebang line, but ... principle of least resistance. --- scripts/a2server-help.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 scripts/a2server-help.txt diff --git a/scripts/a2server-help.txt b/scripts/a2server-help.txt old mode 100755 new mode 100644 From 171ffb52d8f23d0abe4604489b808e10deac9bcb Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Sun, 4 Oct 2015 07:37:11 -0700 Subject: [PATCH 06/11] Add shebang line to a2server-aliases FWIW the reason why I keep adding shebang lines to these scripts that get sourced (and therefore don't need them) is that it alerts a few text editors that offer syntax highlighting based on magic numbers in files that they are in fact bash scripts and contain bashisms that shouldn't be flagged as errors in strict bourne shells. --- scripts/a2server-aliases.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/a2server-aliases.txt b/scripts/a2server-aliases.txt index 607b7b5..4269c76 100755 --- a/scripts/a2server-aliases.txt +++ b/scripts/a2server-aliases.txt @@ -1,3 +1,4 @@ +#! /bin/bash # A2SERVER aliases: From 0afbc6dba1bef1338d5d7838e7e042388883e493 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Sun, 4 Oct 2015 07:51:34 -0700 Subject: [PATCH 07/11] Add A2SERVER_SCRIPT_URL to aliases This should theoretically make the a2server-setup and a2server-update aliases use/honor A2SERVER_SCRIPT_URL if it's set. How this is done is presently kind of ugly since it invokes a subshell to ensure the URL ends in a slash, so if someone has a better idea of how to do that in a bash alias, please file a ticket! --- scripts/a2server-aliases.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/a2server-aliases.txt b/scripts/a2server-aliases.txt index 4269c76..cae89a7 100755 --- a/scripts/a2server-aliases.txt +++ b/scripts/a2server-aliases.txt @@ -1,12 +1,11 @@ #! /bin/bash # A2SERVER aliases: - alias a2server-help="more /usr/local/etc/a2server-help.txt" -alias a2server-setup="wget -q -O /tmp/a2server-setup appleii.ivanx.com/a2server/setup/; source /tmp/a2server-setup" +alias a2server-setup="wget -q -O /tmp/a2server-setup ${A2SERVER_SCRIPT_URL:-http://appleii.ivanx.com/a2server}$([[ "$A2SERVER_SCRIPT_URL" == */ ]] || echo -n "/")setup/; source /tmp/a2server-setup" alias a2server-version="cat /usr/local/etc/A2SERVER-version" -alias a2server-update="wget -q -O /tmp/a2server-update appleii.ivanx.com/a2server/update/; source /tmp/a2server-update" +alias a2server-update="wget -q -O /tmp/a2server-update ${A2SERVER_SCRIPT_URL:-http://appleii.ivanx.com/a2server}$([[ "$A2SERVER_SCRIPT_URL" == */ ]] || echo -n "/")update/; source /tmp/a2server-update" alias system-shutdown='sudo shutdown -h now' alias system-restart='sudo shutdown -r now' From 616a3848152fbdb24490f45688757d543326eebc Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Sun, 4 Oct 2015 08:00:24 -0700 Subject: [PATCH 08/11] Bump version to 1.25 End-user functionality has changed warranting a version bump when these changes are released. --- setup/index.txt | 2 +- update/index.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/index.txt b/setup/index.txt index 9223c23..05cd345 100755 --- a/setup/index.txt +++ b/setup/index.txt @@ -8,7 +8,7 @@ # to download and execute, type: # wget appleii.ivanx.com/a2server/setup; source setup -a2serverVersion="124" +a2serverVersion="125" # Ensure URL we'll use ends in a / case "$A2SERVER_SCRIPT_URL" in diff --git a/update/index.txt b/update/index.txt index f2e2d3d..c4fda99 100755 --- a/update/index.txt +++ b/update/index.txt @@ -1,6 +1,6 @@ #! /bin/bash -currentVersion=124 +currentVersion=125 if [[ -f /usr/local/etc/A2SERVER-version ]]; then installedVersion=$(cat /usr/local/etc/A2SERVER-version) From be694083687e7f31b032275d42f869ced99afa00 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Sun, 4 Oct 2015 09:08:44 -0700 Subject: [PATCH 09/11] Update README.md a little --- README.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 920b127..72a4770 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,32 @@ # A2SERVER -AppleTalk server for Apple // computers +AppleTalk server for Apple // computers developed by Ivan Drucker + +Documentation here is sparse for the moment; see [Ivan's site]() for +information about A2SERVER and how it all works. There's a lot there and it's +kind of evolved organically over the years just as the scripts themselves +have, so it's going to be awhile before that information can be backfilled and +perhaps organized into something you might call a user manual. + +Such a manual should not be considered a replacement for Ivan's organic online +documentation--those contents themselves represent Apple // history, if a +relatively modern piece of it. As such they should be preserved as they are. + +## Developer note + +To use the scripts on a server other than Ivan's, you need to do two things. +First, the server needs to be modified to serve setup/index.txt and +update/index.txt the same way they would serve index.html. How you do that is +beyond the scope of this repository for the moment. Secondly, you'll want to +set the shell variable A2SERVER_SCRIPT_URL to the base URL of this repository +on your server. The base-URL should be slash-terminated. You can then run +the following snippet: + +```bash +wget a2server-setup ${A2SERVER_SCRIPT_URL}setup/; source a2server-setup +``` + +You should probably export A2SERVER_SCRIPT_URL in your .bashrc or whatever +file configures your development environment. Also be advised that as of +version 1.24 of A2SERVER, you must use the snippet above. + +[Ivan's site]: http://appleii.ivanx.com/a2server/ From 4125590bdb57827f3003d68480e6acdc37b307c2 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Sun, 4 Oct 2015 09:23:48 -0700 Subject: [PATCH 10/11] Update changelog --- versionhistory.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/versionhistory.txt b/versionhistory.txt index cb38802..dc477bf 100644 --- a/versionhistory.txt +++ b/versionhistory.txt @@ -49,3 +49,6 @@ 1.2.3: May 2015: changed Apple software links to Internet Archive 1.2.4: Jul 2015: offer to download A2CLOUD disk contents onto A2FILES volume + +1.2.5: Oct 2015: support for using A2SERVER scripts from a location other than + appleii.ivanx.com/a2server for development purposes From 9601ed3e148824ec3bc80e27e087242d8e15dff6 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Mon, 5 Oct 2015 23:52:43 -0700 Subject: [PATCH 11/11] Remove trailing whitespace An unusual quirk of git is that it tends not to like trailing whitespace at the end of lines, and trailing blank lines at the end of a file. It messes with the word diffs a bit I think. Anyway, it's easily removed, so I've removed it. --- scripts/a2server-1-storage.txt | 10 ++-- scripts/a2server-2-tools.txt | 2 +- scripts/a2server-3-sharing.txt | 38 ++++++------- scripts/a2server-5-netboot.txt | 88 +++++++++++++++--------------- scripts/a2server-6-samba.txt | 20 +++---- scripts/a2server-7-console.txt | 20 +++---- scripts/tools/a2server-aliases.txt | 9 --- scripts/tools/a2server-help.txt | 5 +- scripts/tools/afpsync.txt | 6 +- scripts/tools/afptype.txt | 22 ++++---- scripts/tools/cppo.txt | 13 ++--- scripts/tools/mkatinit.txt | 25 ++++----- scripts/tools/mkvolinfo.txt | 2 +- setup/index.txt | 26 ++++----- 14 files changed, 137 insertions(+), 149 deletions(-) diff --git a/scripts/a2server-1-storage.txt b/scripts/a2server-1-storage.txt index 414fe8e..009e4e3 100755 --- a/scripts/a2server-1-storage.txt +++ b/scripts/a2server-1-storage.txt @@ -7,13 +7,13 @@ if [[ -d /media/A2SHARED ]]; then echo "A2SERVER: Shared disk is already prepared for use." - + else - + echo "A2SERVER: Preparing the shared files disk..." - + sudo mkdir /media/A2SHARED - + sudo chown $USER:$USER /media/A2SHARED -fi \ No newline at end of file +fi diff --git a/scripts/a2server-2-tools.txt b/scripts/a2server-2-tools.txt index 1930ebc..f65b7e6 100755 --- a/scripts/a2server-2-tools.txt +++ b/scripts/a2server-2-tools.txt @@ -73,7 +73,7 @@ if [[ ! -f /usr/local/bin/unar ]]; then sudo apt-get -y update touch /tmp/a2server-packageReposUpdated fi - + if [[ $isRpi || $isDebian ]]; then sudo apt-get -y install libgnustep-base1.22 sudo apt-get clean diff --git a/scripts/a2server-3-sharing.txt b/scripts/a2server-3-sharing.txt index 21c545c..e9fadde 100755 --- a/scripts/a2server-3-sharing.txt +++ b/scripts/a2server-3-sharing.txt @@ -34,14 +34,14 @@ isDebian= if [[ -f /usr/local/etc/A2SERVER-version ]] && (( $(cat /usr/local/etc/A2SERVER-version) >= 101 )); then echo "A2SERVER: Netatalk is already installed." - + else echo "A2SERVER: Installing Netatalk (this will take a while)..." - + # stop Netatalk if running (during upgrade) [[ $(ps --no-headers -C afpd) ]] && sudo /etc/init.d/netatalk stop - + if [[ ! -f /tmp/a2server-packageReposUpdated ]]; then # prepare for installing packages sudo apt-get -y update @@ -70,7 +70,7 @@ else else break fi - + # install Netatalk if [[ $isRpi ]]; then { wget -qO- /tmp/netatalk.tgz "http://appleii.ivanx.com/a2server/files/netatalk224-rpi.tgz" | sudo tar Pzx; } 2> /dev/null @@ -78,7 +78,7 @@ else { wget -qO- /tmp/netatalk.tgz "http://appleii.ivanx.com/a2server/files/netatalk224-debian7_x86.tgz" | sudo tar Pzx; } 2> /dev/null fi sudo mandb &> /dev/null - + [[ -f /usr/local/sbin/atalkd ]] && compileFromSource= break @@ -98,39 +98,39 @@ else sudo apt-get -y install libssl-dev sudo apt-get -y install libgcrypt11-dev sudo apt-get clean - + # get Netatalk rm -rf /tmp/netatalk &> /dev/null mkdir /tmp/netatalk cd /tmp/netatalk - + wget -q "http://downloads.sourceforge.net/project/netatalk/netatalk/2.2.4/netatalk-2.2.4.tar.gz" tar zxf netatalk-2.2.4.tar.gz cd netatalk-2.2.4 - + # Patch the source so file dates are preserved during a GS/OS folder copy, # and the AsanteTalk bridge consistently starts up in AppleTalk Phase 2 # and the Dayna bridge doesn't crash GS/OS # props to Steven Hirsch for these sed -i ':a;N;$!ba;s/case FILPBIT_ATTR :\n *change_mdate = 1;\n/case FILPBIT_ATTR :\n/g' etc/afpd/file.c sed -i 's/rtmp->rt_iface == iface/rtmp->rt_iface != iface/g' etc/atalkd/main.c - + # prepare to build Netatalk ./configure --enable-debian --enable-ddp --enable-a2boot - + # uninstall Netatalk if already installed [[ -f /usr/local/sbin/afpd ]] && sudo make uninstall - + # compile and install Netatalk make sudo make install - + # to remove the Netatalk source code (optional), type: cd rm -rf /tmp/netatalk - fi + fi fi - + # --- Configuring Netatalk echo "A2SERVER: Configuring Netatalk..." @@ -213,7 +213,7 @@ if [[ $isRpi ]]; then # echo -e "\n\n#for USB-to-serial adapter with Prolific PL2303 chipset\nT1:23:respawn:/sbin/getty -L ttyUSB0 19200 vt100" | sudo tee -a /etc/inittab > /dev/null #fi fi - + # set up GSFILES share (for GS data files, not GSOS system) # classic Mac OS file names are allowed (31 chars, mixed case, everything but colons) sudo sed -i \ @@ -235,7 +235,7 @@ if [[ ! -d /media/A2SHARED/A2FILES/.AppleDesktop ]]; then ln -s .AppleDesktop .APPLEDESKTOP fi -# set up ADTDISKS share (ADTPro disk image folder, if A2CLOUD is installed) +# set up ADTDISKS share (ADTPro disk image folder, if A2CLOUD is installed) # classic Mac OS file names are allowed (31 chars, mixed case, everything but colons) if [[ -d /usr/local/adtpro/disks ]]; then # A2CLOUD/ADTPro installed if [[ ! -d /media/A2SHARED/ADTDISKS ]]; then @@ -264,7 +264,7 @@ else echo echo "A2SERVER: Setting up AFP password 'apple2' for Apple II and Mac clients." # echo "A2SERVER: Enter 'apple2' or another password of up to eight characters." - echo + echo # set registered user login using RandNum authentication sudo afppasswd -c sudo sed -i 's/^pi.*$/pi:6170706C65320000:****************:********/' /usr/local/etc/netatalk/afppasswd @@ -321,8 +321,8 @@ echo "A2SERVER: Netatalk is installed, configured, and running." echo # if atalkd isn't running (no AppleTalk), and this is a Rasbperry Pi: -if [[ ( ! $(ps aux | grep [a]talkd) ) && ( $isRpi ) ]]; then - +if [[ ( ! $(ps aux | grep [a]talkd) ) && ( $isRpi ) ]]; then + # if AppleTalk module exists, try to load it if [[ -f /lib/modules/$kernelRelease/kernel/net/appletalk/appletalk.ko ]]; then # module present, but not loaded? sudo depmod diff --git a/scripts/a2server-5-netboot.txt b/scripts/a2server-5-netboot.txt index 4ef464e..0ab29dd 100755 --- a/scripts/a2server-5-netboot.txt +++ b/scripts/a2server-5-netboot.txt @@ -29,35 +29,35 @@ adtproDir=$commDir/ADTPRO # bail out on automated netboot setup unless -b is also specified [[ -f /tmp/a2server-autoAnswerYes ]] && autoAnswerYes=1 || autoAnswerYes= if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then - + if [[ ! $autoAnswerYes ]]; then echo echo "Do you want to set up A2SERVER to be able to boot Apple II" echo -n "computers over the network? " read fi - + if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then - + nbmode=1 echo - + sudo true mkdir -p /tmp/netboot cd /tmp/netboot - + # this will get "Disk 7" (Apple II Setup) as a raw (block dump) image if [[ ! -f /usr/local/etc/netatalk/a2boot/ProDOS16\ Boot\ Blocks ]] \ || [[ ! -f /usr/local/etc/netatalk/a2boot/ProDOS16\ Image ]] \ || [[ ! -f /usr/local/etc/netatalk/a2boot/Apple\ :2f:2fe\ Boot\ Blocks ]]; then echo "A2SERVER: Downloading Apple II Boot Blocks..." cd /tmp/netboot - + wget -qO Disk_7_of_7-Apple_II_Setup.sea.bin http://archive.org/download/download.info.apple.com.2012.11/download.info.apple.com.2012.11.zip/download.info.apple.com%2FApple_Support_Area%2FApple_Software_Updates%2FEnglish-North_American%2FApple_II%2FApple_IIGS_System_6.0.1%2FDisk_7_of_7-Apple_II_Setup.sea.bin unar -k skip Disk_7_of_7-Apple_II_Setup.sea.bin &> /dev/null truncate -s 819284 'Disk 7 of 7-Apple II Setup.sea' dd if='Disk 7 of 7-Apple II Setup.sea' of=APPLE2SETUP.HDV bs=84 skip=1 2> /dev/null - + # copy the Boot Blocks into the right place mkdir -p a2setup sudo mount -t hfs -o ro,loop APPLE2SETUP.HDV a2setup @@ -65,8 +65,8 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then sudo cp -p a2setup/System\ Folder/* /usr/local/etc/netatalk/a2boot sudo umount a2setup sudo mv /usr/local/etc/netatalk/a2boot/Apple* /usr/local/etc/netatalk/a2boot/'Apple :2f:2fe Boot Blocks' - - cd /usr/local/etc/netatalk/a2boot + + cd /usr/local/etc/netatalk/a2boot # thanks to Geoff Body for these Boot Blocks patches # fix cleartext password login bug echo -n -e "\xA8\xA2\x01\xBD\x80\x38\x99\xA0\x38\xC8\xE8\xE0\x09\x90\xF4" | \ @@ -80,7 +80,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then sudo dd of='ProDOS16 Image' bs=1661 seek=1 conv=notrunc 2> /dev/null fi echo "A2SERVER: Boot Blocks have been installed." - + # get a2server-tools if necessary if [[ ! -f /usr/local/bin/mkatinit ]] \ || [[ ! -f /usr/local/bin/afptype ]] \ @@ -92,12 +92,12 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then /tmp/2.tools rm /tmp/2.tools fi - + # put BASIC.SYSTEM at root for ProDOS 8 startup - cp -p /usr/local/etc/netatalk/a2boot/Basic.System $gsosDir/BASIC.SYSTEM + cp -p /usr/local/etc/netatalk/a2boot/Basic.System $gsosDir/BASIC.SYSTEM afpsync -v $gsosDir > /dev/null afptype -p SYS -q $gsosDir/BASIC.SYSTEM - + # create tools for setting GS/OS or ProDOS 8 boot in battery RAM and rebooting. Props yet again to Geoff Body. if [[ ! -f $p8Dir/NETBOOT.P8 ]]; then echo @@ -118,10 +118,10 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then afpsync -v $gsosDir > /dev/null afptype -p SYS -q $gsosDir/NETBOOT.GSOS fi - + mkatinit -gs -d -f # GS/OS registered user and Guest starts up with SYSTEM/FINDER mkatinit -d -f guest # ProDOS 8 Guest starts up with BASIC.SYSTEM (no registered user) - + if [[ -f "/media/A2SHARED/A2FILES/SYSTEM/START.GS.OS" ]]; then echo "A2SERVER: GS/OS has already been downloaded and installed." gsosInstall=1 @@ -133,7 +133,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then fi if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then gsosInstall=1 - + # get GS/OS disks from Internet Archive and put them in IMAGES # also dump contents into NET.INSTALL and modify scripts to work from there # echo @@ -158,9 +158,9 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then done rm *.sea* &> /dev/null sed -i "s/\([^\\]\r:\)/\1A2FILES:GSOS.INSTALLER:NET.INSTALL:/g" $netInstallDir/INSTALL/SCRIPTS/* - + afpsync -v $gsosDir > /dev/null - + # install GS/OS # spec for GS/OS installer scripts: GS/OS Tech Note #64 # http://www.1000bit.it/support/manuali/apple/technotes/iigs/tn.iigs.064.html @@ -186,7 +186,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then targetFile=${targetPath##*/} sourceParent=${sourcePath%/*} sourceFile=${sourcePath##*/} - + if [[ $action == 1 || $action == 2 ]]; then mkdir -p $targetParent echo "copying: $sourcePathMixed" @@ -207,22 +207,22 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then done unset IFS } - + mkdir -p /tmp/netboot cd /tmp/netboot - - echo "A2SERVER: Preparing GS/OS installer scripts..." + + echo "A2SERVER: Preparing GS/OS installer scripts..." # work through installer scripts processScript $netInstallDir/INSTALL/SCRIPTS/INSTAL.SYS.FILE processScript $netInstallDir/INSTALL/SCRIPTS/APPLESHARE processScript $netInstallDir/INSTALL/SCRIPTS/SERVER.SYS.FILE - + # sync netatalk database afpsync -v $gsosDir > /dev/null - + fi fi - + if [[ ! $autoAnswerYes ]]; then echo echo "Do you want to download and install utilities for working with" @@ -230,11 +230,11 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then read fi if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then - + # download image tools and put them in IMAGE.TOOLS echo "A2SERVER: Downloading GS/OS disk image utilities..." mkdir -p $imageToolsDir - + # get Asimov2 (for GS/OS) echo -n "Asimov 2.0" if [[ -f $imageToolsDir/ASIMOV ]]; then @@ -249,7 +249,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then cat Asimov/Asimov_rsrc_ >> $imageToolsDir/.AppleDouble/ASIMOV afptype -p S16 -q $imageToolsDir/ASIMOV fi - + echo -n "GS-ShrinkIt 1.1" # get GS-ShrinkIt if [[ -f $imageToolsDir/GSHK ]]; then @@ -265,8 +265,8 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then cat GSHK_rsrc_ >> $imageToolsDir/.AppleDouble/GSHK afptype -p S16 -a DB07 -q $imageToolsDir/GSHK fi - - echo -n "MountIt 1.4" + + echo -n "MountIt 1.4" # get MountIt (for GS/OS) if [[ -f $imageToolsDir/MOUNTIT.SHK ]]; then echo " is already installed." @@ -287,11 +287,11 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then read fi if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then - + echo "A2SERVER: Downloading ProDOS 8 disk image utilities..." mkdir -p $diskToolsP8Dir - + echo -n "ShrinkIt 3.4" # get ShrinkIt 3.4 (for ProDOS 8) if [[ -f $diskToolsP8Dir/SHRINKIT ]]; then @@ -305,7 +305,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then cppo -s -ad SHRINKIT /SHRINKIT/SHRINKIT $diskToolsP8Dir 2> /dev/null afpsync -v $sharepath > /dev/null fi - + echo -n "DSK2FILE 5.8" # get DSK2FILE (for ProDOS 8) if [[ -f $diskToolsP8Dir/DSK2FILE ]]; then @@ -319,7 +319,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then afpsync -v $sharepath > /dev/null afptype -p SYS -q $diskToolsP8Dir/DSK2FILE fi - + echo -n "Apple System Utilities 3.1" if [[ -f $diskToolsP8Dir/SYSUTIL ]]; then echo " is already installed." @@ -336,7 +336,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then cppo -s -ad A2SYSDISK32.HDV /UTILITIES/UTIL.2 $diskToolsP8Dir 2> /dev/null afpsync -v $sharepath > /dev/null fi - + fi if [[ ! $autoAnswerYes ]]; then @@ -346,11 +346,11 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then read fi if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then - + echo "A2SERVER: Downloading communications software..." mkdir -p $commDir - + echo -n "Spectrum" # get Spectrum if [[ -f $commDir/SPECTRUM/SPECTRUM.HDV ]]; then @@ -386,7 +386,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then mv *PT3* *PROTERM* $protermDir/.AppleDouble mv Z.LINK $zlinkDir/.AppleDouble afpsync -v $gsosDir > /dev/null - fi + fi echo -n "ADTPro and VSDRIVE" if [[ -f $commDir/ADTPRO/ADTPRO ]]; then @@ -400,25 +400,25 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then cd .AppleDouble mv *ADTPRO* *VEDRIVE* *VSDRIVE* $adtproDir/.AppleDouble afpsync -v $gsosDir > /dev/null - fi + fi fi - + # clean up cd [[ -d /tmp/netboot ]] && rm -rf /tmp/netboot [[ -d ~/GNUstep ]] && rm -rf ~/GNUstep - + # rock and roll! echo - + echo if (( $gsosInstall )); then echo "GS/OS network boot (for registered user and Guest) and" fi echo "ProDOS 8 network boot (for Guest only) is now configured." - echo "See http://appleii.ivanx.com/a2server for info using it." - + echo "See http://appleii.ivanx.com/a2server for info using it." + fi if [[ ! $autoAnswerYes ]]; then diff --git a/scripts/a2server-6-samba.txt b/scripts/a2server-6-samba.txt index f109a74..fb740e4 100755 --- a/scripts/a2server-6-samba.txt +++ b/scripts/a2server-6-samba.txt @@ -13,10 +13,10 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupWindowsSharing ]]; then read fi if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then - + echo "A2SERVER: Setting up Windows file sharing..." sudo true - + if [[ $(lsb_release -d 2> /dev/null | grep Ubuntu) ]]; then [[ -f /etc/init/smbd.conf.off ]] && sudo mv /etc/init/smbd.conf.off /etc/init/smbd.conf [[ -f /etc/init/nmbd.conf.off ]] && sudo mv /etc/init/nmbd.conf.off /etc/init/nmbd.conf @@ -25,26 +25,26 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupWindowsSharing ]]; then sudo update-rc.d samba defaults &> /dev/null [[ ! -f /etc/init.d/samba ]] && installSamba=1 fi - + if (( $installSamba )); then if [[ ! -f /tmp/a2server-packageReposUpdated ]]; then # prepare for installing packages sudo apt-get -y update touch /tmp/a2server-packageReposUpdated fi - + sudo apt-get -y install samba [[ -f /usr/bin/smbpasswd ]] || sudo apt-get -y install samba-common-bin sudo apt-get clean fi - + if [[ $(lsb_release -d 2> /dev/null | grep Ubuntu) ]]; then sudo initctl start smbd &> /dev/null sudo initctl start nmbd &> /dev/null else sudo /etc/init.d/samba start &> /dev/null fi - + workgroup=$(grep -o "^ workgroup = .*$" /etc/samba/smb.conf 2> /dev/null | cut -c 16-) [[ $workgroup ]] || workgroup="WORKGROUP" if [[ ! $autoAnswerYes ]]; then @@ -55,7 +55,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupWindowsSharing ]]; then fi sudo sed -i 's/^ workgroup = .*$/ workgroup = '$workgroup'/' /etc/samba/smb.conf 2> /dev/null sudo sed -i 's/^# security = user/ security = user/' /etc/samba/smb.conf 2> /dev/null - + grep ^/media /usr/local/etc/netatalk/AppleVolumes.default | cut -d" " -f2 \ | while read sharename; do if [[ $(grep $sharename /etc/samba/smb.conf) ]]; then @@ -71,7 +71,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupWindowsSharing ]]; then echo "A2SERVER: $sharename has been set up for Windows file sharing." fi done - + echo echo "A2SERVER: Setting Windows file sharing password to 'apple2'." echo -e 'apple2\napple2' | sudo smbpasswd -s -a $USER @@ -90,6 +90,6 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupWindowsSharing ]]; then fi echo "A2SERVER: Windows file sharing has been turned off." fi - + echo -fi \ No newline at end of file +fi diff --git a/scripts/a2server-7-console.txt b/scripts/a2server-7-console.txt index 4ab6fc2..185e8eb 100755 --- a/scripts/a2server-7-console.txt +++ b/scripts/a2server-7-console.txt @@ -35,10 +35,10 @@ if [[ $(lsb_release -d 2> /dev/null | grep Ubuntu) ]]; then echo "A2SERVER: Logged in via SSH,not performing console optimization." echo "Run setup from the console if you want to optimize the console." else - + # if we've already done this stuff, don't do it again if [[ ! -x /etc/update-motd.d/10-help-text ]]; then - + echo "A2SERVER: Ubuntu console has already been optimized." else echo "Ubuntu console optimization for use in a virtual machine will:" @@ -54,39 +54,39 @@ if [[ $(lsb_release -d 2> /dev/null | grep Ubuntu) ]]; then read fi if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then - + echo "A2SERVER: Optimizing console..." - + # remind the user how to log in (we're going for functionality here, not security) if [[ ! $(grep $USER\/$password /etc/issue) ]]; then sudo sed -i '/^Log in with.*$/d' /etc/issue echo "Log in with '$USER' / '$password'." | sudo tee -a /etc/issue > /dev/null echo | sudo tee -a /etc/issue > /dev/null fi - + # If after logging in, you don't like the documentation URL and # system info (or an error about it) being displayed, type: sudo chmod -x /etc/update-motd.d/10-help-text sudo chmod -x /etc/update-motd.d/50-landscape-sysinfo - + # If the screen doesn't clear for login after the boot messages, and # you'd like it to, type: sudo sed -i 's/X_DEFAULT=""/X_DEFAULT="quiet"/g' /etc/default/grub sudo update-grub - + # If you see a piix4_smbus error on startup, it is harmless, but if you # want to eliminate it, type: echo -e '\nblacklist i2c_piix4' \ | sudo tee -a /etc/modprobe.d/blacklist.conf > /dev/null sudo update-initramfs -u -k all - + # If you want to prevent the Ubuntu screen from going blank after ten # minutes of inactivity (once you are logged in), type: echo -e \ '\n[[ $SSH_CLIENT || $REMOTEHOST ]] || setterm -blank 0 -powersave off -powerdown 0' \ | sudo tee -a /etc/profile > /dev/null setterm -blank 0 -powersave off -powerdown 0 - + # (note: These next lines addresses an issue only for Ubuntu 10.04.) # Type "ps aux" and press return. If you see slow text scrolling, type: if [[ "$(lsb_release -rs 2> /dev/null)" == "10.04" ]]; then @@ -102,4 +102,4 @@ if [[ $(lsb_release -d 2> /dev/null | grep Ubuntu) ]]; then fi fi fi -fi \ No newline at end of file +fi diff --git a/scripts/tools/a2server-aliases.txt b/scripts/tools/a2server-aliases.txt index cae89a7..e8ef1c0 100755 --- a/scripts/tools/a2server-aliases.txt +++ b/scripts/tools/a2server-aliases.txt @@ -75,12 +75,3 @@ alias a2files-share="sudo sed -i 's/^\/media\/A2SHARED\/A2FILES\ A2FILES options alias a2files-unshare="sudo sed -i 's/^#share2/\/media\/A2SHARED\/A2FILES\ A2FILES options:prodos\ casefold:toupper/' /usr/local/etc/netatalk/AppleVolumes.default; [[ -d /media/A2SHARED/A2FILES ]] || mkdir /media/A2SHARED/A2FILES" alias showalias="alias | cut -d= -f 1 | cut -d' ' -f2 | more" - - - - - - - - - diff --git a/scripts/tools/a2server-help.txt b/scripts/tools/a2server-help.txt index 2918a55..e763ac6 100644 --- a/scripts/tools/a2server-help.txt +++ b/scripts/tools/a2server-help.txt @@ -21,7 +21,7 @@ showip: show the current ethernet IP address of the server showmac: show the MAC (Ethernet hardware) address of the server showip-wifi: show the current wifi IP address of the server showmac-wifi: show the MAC (wifi hardware) address of the server -ifreset: reset all network interfaces (requires restart) +ifreset: reset all network interfaces (requires restart) netatalk-stop: stop the netatalk service until reboot netatalk-start: start the netatalk service @@ -57,7 +57,7 @@ netboot-p8-guest: set guests to netboot into ProDOS 8 (default) note: when a IIgs is set to network boot into GS/OS, using the Network control panel or the NETBOOT.GSOS utility, guests will behave like registered users, and ignore the netboot setting of the guest user - + guest-off: disallow guest access to A2SERVER guest-on: allow guest access to A2SERVER (default) note: by default, Guest access is the only way to network boot into @@ -83,4 +83,3 @@ afpsync: register files introduced outside of AFP with netatalk mkatinit: set up network boot configuration files cppo: catalog and copy files from ProDOS image file (slow, but works) (add -h to show help for the above four commands, e.g. "afptype -h") - diff --git a/scripts/tools/afpsync.txt b/scripts/tools/afpsync.txt index af0c70f..91f2640 100755 --- a/scripts/tools/afpsync.txt +++ b/scripts/tools/afpsync.txt @@ -76,7 +76,7 @@ while [[ $1 == "-r" || $1 == "-e" || $1 = "-v" ]]; do force=1 shift fi - + if [[ $1 == "-e" ]]; then showerrors=1 shift @@ -103,7 +103,7 @@ else if [[ $1 ]]; then sharepath=$(readlink -m $1) processPath - else + else grep ^/media /usr/local/etc/netatalk/AppleVolumes.default | \ while read line; do [[ $(echo $line | grep toupper) ]]; nocasefold=$? @@ -111,4 +111,4 @@ else processPath nocasefold done fi -fi \ No newline at end of file +fi diff --git a/scripts/tools/afptype.txt b/scripts/tools/afptype.txt index ebbdbaa..2d64c44 100755 --- a/scripts/tools/afptype.txt +++ b/scripts/tools/afptype.txt @@ -295,7 +295,7 @@ exit_usage () { echo " two hex digits for untypeables (note: use '\xZZ' for 00)." echo "ProDOS type should be two hex digits, and auxtype should be four;" echo " type can alternatively be BAS, BIN, INT, P16, S16, SHK, SYS, TXT." - echo "-q skips recheck of file (show types) after setting" + echo "-q skips recheck of file (show types) after setting" echo exit 1 } @@ -359,7 +359,7 @@ while [[ $1 && ( "${1:0:1}" == '-' ) ]]; do continue else exit_usage - break + break fi done @@ -393,7 +393,7 @@ for filename in $@; do fi entrycount=`readcharDec "$filename" 25` - + entry=1 offset=29 @@ -406,7 +406,7 @@ for filename in $@; do (( offset = (entry * 12 + 29) - 12 )) done (( entry > entrycount )) && continue - + (( offset = offset + 3 )) (( tposHi = $(readcharDec "$filename" $offset) * 256 )) (( offset = offset + 1 )) @@ -414,7 +414,7 @@ for filename in $@; do (( cpos = tpos + 4 )) (( ppos = tpos + 1 )) (( apos = tpos + 2 )) - + if [[ $p || $a || $t || $c ]]; then # set if [[ $p || $a ]]; then if [[ $p ]]; then @@ -447,9 +447,9 @@ for filename in $@; do type="$(readchars "$filename" $tpos 4)" creator="$(readchars "$filename" $cpos 4)" - + echo -n "$linestart" - + if [[ $creator != "pdos" || ( ( $type != "TEXT" ) \ && ( $type != "PSYS" ) && ( ${type:0:1} != "p" ) ) ]]; then if [[ $creator || $type ]]; then @@ -459,7 +459,7 @@ for filename in $@; do fi continue fi - + if [[ $type == "TEXT" ]]; then pdosType="\$04 [TXT]" pdosAuxType='$0000' @@ -475,14 +475,14 @@ for filename in $@; do break fi done - + (( tpos=tpos+1 )) auxTypeHi=$(readcharHex "$filename" $tpos) (( tpos=tpos+1 )) auxTypeLo=$(readcharHex "$filename" $tpos) pdosAuxType=$auxTypeHi$auxTypeLo fi - + echo "ProDOS file. Type:\$$pdosType AuxType:\$$pdosAuxType" fi @@ -495,4 +495,4 @@ done # test on lunix # test inside and outside of AD directory, and from other dirs (both cases) # finish conversion writebyte/readchar library -# consider return 2 for missing parameters for subroutines \ No newline at end of file +# consider return 2 for missing parameters for subroutines diff --git a/scripts/tools/cppo.txt b/scripts/tools/cppo.txt index fdbf660..39f8a5e 100755 --- a/scripts/tools/cppo.txt +++ b/scripts/tools/cppo.txt @@ -132,7 +132,7 @@ def getFileName(arg1, arg2): def getFileType(arg1, arg2): start = getStartPos(arg1, arg2) return readcharHex(g.imageData, start+16) - + def getKeyPointer(arg1, arg2): start = getStartPos(arg1, arg2) return (readcharDec(g.imageData, start+17) + @@ -364,7 +364,7 @@ def processEntry(arg1, arg2): if g.PDOSPATH_SEGMENT: syncExit() g.targetName = None - + #else: #print(g.activeFileName + " doesn't match " + g.PDOSPATH_SEGMENT) @@ -505,7 +505,7 @@ def binToDec(arg1): # arg: binary string up to 8 bits # out: decimal value return to_dec([arg1]) - + def binToHex(arg1): # converts single-byte binary string (8 bits) value to hex # warning: no error checking @@ -699,10 +699,10 @@ def to_bytes(val): else: raise Exception( "to_bytes() requires hex-ustr, int/long, or [bin-ustr]") - + def shift(items): """Shift list items to left, losing the first item. - + in : list out: list """ @@ -710,7 +710,7 @@ def shift(items): items[i] = items[i+1] del items[-1] return items - + def s(string): """Perform local variable substution, e.g. 'total: {num} items'""" # http://stackoverflow.com/questions/2960772/ @@ -879,4 +879,3 @@ else: processDir(2) if not g.DIR: syncExit() - diff --git a/scripts/tools/mkatinit.txt b/scripts/tools/mkatinit.txt index c1fa802..79311c5 100755 --- a/scripts/tools/mkatinit.txt +++ b/scripts/tools/mkatinit.txt @@ -96,7 +96,7 @@ while [ -n "$1" ] && [ "${1:0:1}" = '-' ]; do continue else badflag=1 - break + break fi done @@ -156,10 +156,10 @@ while : ; do prefix="$gsprefix" fi fi - + # make username all caps username=`echo $username | tr '[:lower:]' '[:upper:]'` - + # prompt for folders if [ ! $doalsoguest ] && [ ! $noprompt ]; then while : ; do @@ -174,7 +174,7 @@ while : ; do fi break done - + while : ; do echo "Enter the initial ProDOS prefix:" echo "default (CR to accept): $prefix" @@ -188,10 +188,10 @@ while : ; do break done fi - + # create folders if needed filepath="$PWD/$filename" - + while [ $usersfolder -eq 1 ]; do # create folders for ATINIT while [ ! -d "$sharepath" ]; do @@ -199,7 +199,7 @@ while : ; do echo "Enter the local path to the netatalk shared volume used for netboot:" read sharepath done - + if [ ! -d "$sharepath/USERS" ]; then mkdir "$sharepath/USERS" if [ $? -ne 0 ]; then @@ -222,12 +222,12 @@ while : ; do break fi fi - + # we have a valid USERS folder target for ATINIT filepath="$sharepath/USERS/$username/SETUP/$filename" usersfolder=2 done - + if [ $usersfolder -eq 1 ]; then echo "Could not write to shared volume. Creating ATINIT in current directory." if [ -n "$alsoguest" ]; then @@ -242,7 +242,7 @@ while : ; do echo "netboot start prefix : $prefix" echo fi - + #remove ATINIT if present if [ ! $overwrite ] && [ -f "$filepath" ]; then echo -n "$filepath already exists. Overwrite? " @@ -259,7 +259,7 @@ while : ; do fi done fi - + #write the file. start with zeroes dd if=/dev/zero of="$filepath" bs=1 count=276 2> /dev/null #put in startprog, prefix, username (first byte of each field is length) @@ -269,7 +269,7 @@ while : ; do ( decToChar "${#startprog}"; echo -n "$startprog"; ) | writechars "$filepath" 7 ( decToChar "${#prefix}"; echo -n "$prefix"; ) | writechars "$filepath" 78 ( decToChar "${#username}"; echo -n "$username"; ) | writechars "$filepath" 143 - + echo "Created $filepath" if [ ! $alsoguest ]; then break @@ -283,4 +283,3 @@ while : ; do done echo - diff --git a/scripts/tools/mkvolinfo.txt b/scripts/tools/mkvolinfo.txt index d981670..82bbf27 100755 --- a/scripts/tools/mkvolinfo.txt +++ b/scripts/tools/mkvolinfo.txt @@ -27,7 +27,7 @@ while [[ $1 == "-f" || $1 == "-c" ]]; do force=1 shift fi - + if [[ $1 == "-c" ]]; then mixedcase=1 shift diff --git a/setup/index.txt b/setup/index.txt index 05cd345..9d67f52 100755 --- a/setup/index.txt +++ b/setup/index.txt @@ -108,7 +108,7 @@ if (( unsupportedOS )); then echo "operating system version. Continuing is probably fine, but might not be." echo "Worst case could make your operating system no longer work properly," echo "or cause data to be lost." - echo "More information is at http://appleii.ivanx.com/a2server." + echo "More information is at http://appleii.ivanx.com/a2server." fi doSetup=1 @@ -135,7 +135,7 @@ if (( $doSetup )); then read [[ ${REPLY:0:1} == "y" || ${REPLY:0:1} == "Y" ]]; doSetup=$(( 1 - $? )) fi - + if (( $doSetup )); then userPw=$(sudo grep "^$USER" /etc/shadow | cut -f 2 -d ':') @@ -145,7 +145,7 @@ if (( $doSetup )); then password="your password" [[ $isApple2Pw ]] && password="'apple2'" [[ $isRaspberryPw ]] && password="'raspberry'" - + [[ $isRpi ]] && a2server="your Raspberry Pi" || a2server="A2SERVER" if [[ ! $isApple2Pw && ! -f /usr/local/etc/A2SERVER-version ]]; then @@ -169,30 +169,30 @@ if (( $doSetup )); then echo sudo true - + echo echo "A2SERVER: Downloading scripts..." - + wget -q -O /tmp/1.storage "${scriptURL}scripts/a2server-1-storage.txt" chmod ugo+x /tmp/1.storage - + wget -q -O /tmp/2.tools "${scriptURL}scripts/a2server-2-tools.txt" chmod ugo+x /tmp/2.tools wget -q -O /tmp/3.sharing "${scriptURL}scripts/a2server-3-sharing.txt" chmod ugo+x /tmp/3.sharing - + wget -q -O /tmp/5.netboot "${scriptURL}scripts/a2server-5-netboot.txt" chmod ugo+x /tmp/5.netboot - + wget -q -O /tmp/6.samba "${scriptURL}scripts/a2server-6-samba.txt" chmod ugo+x /tmp/6.samba - + wget -q -O /tmp/7.console "${scriptURL}scripts/a2server-7-console.txt" chmod ugo+x /tmp/7.console echo "A2SERVER: Scripts have been downloaded. Installing..." - + /tmp/1.storage rm /tmp/1.storage /tmp/2.tools @@ -206,7 +206,7 @@ if (( $doSetup )); then /tmp/7.console rm /tmp/7.console rm /tmp/a2server-packageReposUpdated &> /dev/null - + if [[ ! -f /usr/local/etc/A2SERVER-version ]] \ || (( $(cat /usr/local/etc/A2SERVER-version) < "$a2serverVersion" )); then echo "$a2serverVersion" | sudo tee /usr/local/etc/A2SERVER-version &> /dev/null @@ -261,7 +261,7 @@ if (( $doSetup )); then echo "by typing 'appletalk-on'." echo fi - + if [[ -f /tmp/singleUser ]]; then if [[ ! $autoAnswerYes ]]; then echo "Your Raspberry Pi was started in single-user mode in order to" @@ -276,7 +276,7 @@ if (( $doSetup )); then fi echo fi - + echo echo "Type 'system-shutdown' to turn off A2SERVER." echo "Type 'a2server-setup' to configure network boot."