Merge pull request #4 from iKarith/run-anywhere

Make A2SERVER scripts usable from arbitrary server
This commit is contained in:
Joseph Carter 2015-10-09 06:05:49 -07:00
commit cfc514e09a
17 changed files with 97 additions and 35 deletions

View File

@ -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/

0
scripts/a2server-1-storage.txt Normal file → Executable file
View File

28
scripts/a2server-2-tools.txt Normal file → Executable file
View File

@ -4,6 +4,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
@ -18,9 +24,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- "http://appleii.ivanx.com/a2server/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- "http://appleii.ivanx.com/a2server/files/nulib2-debian7_x86.tgz" | sudo tar Pzx
fi
if [[ ! -f /usr/local/bin/nulib2 ]]; then
@ -73,9 +79,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- "http://appleii.ivanx.com/a2server/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- "http://appleii.ivanx.com/a2server/files/unar-debian7_x86.tgz" | sudo tar Pzx
fi
fi
if [[ ! -f /usr/local/bin/unar ]]; then
@ -101,18 +107,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

14
scripts/a2server-3-sharing.txt Normal file → Executable file
View File

@ -20,6 +20,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
@ -69,9 +75,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 "http://appleii.ivanx.com/a2server/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 "http://appleii.ivanx.com/a2server/files/netatalk224-debian7_x86.tgz" | sudo tar Pzx; } 2> /dev/null
fi
sudo mandb &> /dev/null
@ -134,7 +140,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
@ -335,7 +341,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

14
scripts/a2server-5-netboot.txt Normal file → Executable file
View File

@ -7,6 +7,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
@ -82,7 +88,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
@ -295,7 +301,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
@ -372,7 +378,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
@ -424,7 +430,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

0
scripts/a2server-6-samba.txt Normal file → Executable file
View File

0
scripts/a2server-7-console.txt Normal file → Executable file
View File

View File

@ -1,11 +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'

0
scripts/tools/a2server-help.txt Executable file → Normal file
View File

0
scripts/tools/afpsync.txt Normal file → Executable file
View File

0
scripts/tools/afptype.txt Normal file → Executable file
View File

1
scripts/tools/cppo.txt Normal file → Executable file
View File

@ -879,4 +879,3 @@ else:
processDir(2)
if not g.DIR:
syncExit()

0
scripts/tools/mkatinit.txt Normal file → Executable file
View File

0
scripts/tools/mkvolinfo.txt Normal file → Executable file
View File

22
setup/index.txt Normal file → Executable file
View File

@ -9,7 +9,13 @@
# 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
*/) scriptURL="$A2SERVER_SCRIPT_URL" ;;
*) scriptURL="${A2SERVER_SCRIPT_URL:-http://appleii.ivanx.com/a2server}/" ;;
esac
isRpi=
[[ -f /usr/bin/raspi-config ]] && isRpi=1
@ -71,7 +77,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
@ -168,22 +174,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..."

12
update/index.txt Normal file → Executable file
View File

@ -1,7 +1,7 @@
#! /bin/bash
# vim: set tabstop=4 shiftwidth=4 expandtab filetype=sh:
currentVersion=124
currentVersion=125
if [[ -f /usr/local/etc/A2SERVER-version ]]; then
installedVersion=$(cat /usr/local/etc/A2SERVER-version)
@ -9,6 +9,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
@ -19,7 +25,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}"
@ -33,7 +39,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

View File

@ -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