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.
This commit is contained in:
T. Joseph Carter
2015-10-04 01:23:53 -07:00
parent 8882392383
commit 982836dc7c
5 changed files with 59 additions and 29 deletions
+17 -11
View File
@@ -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
+10 -4
View File
@@ -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
+11 -5
View File
@@ -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
fi