Revert back to upstream state save for docs

This commit is contained in:
T. Joseph Carter
2015-10-22 04:53:03 -07:00
parent a0cacc4888
commit 6eacfc63ab
6 changed files with 135 additions and 301 deletions

View File

@@ -75,7 +75,6 @@ if [[ ! -f /usr/local/bin/unar ]]; then
touch /tmp/a2server-packageReposUpdated touch /tmp/a2server-packageReposUpdated
fi fi
:<<COMMENT
if [[ $isRpi || $isDebian ]]; then if [[ $isRpi || $isDebian ]]; then
sudo apt-get -y install libgnustep-base1.22 sudo apt-get -y install libgnustep-base1.22
sudo apt-get clean sudo apt-get clean
@@ -85,17 +84,16 @@ if [[ ! -f /usr/local/bin/unar ]]; then
wget -qO- "http://appleii.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
fi fi
COMMENT if [[ ! -f /usr/local/bin/unar ]]; then
if [[ ! -f /usr/local/bin/unar || "`/usr/local/bin/unar -v`" != "v1.9.1" ]]; then sudo apt-get -y install build-essential
sudo apt-get -y install build-essential \ sudo apt-get -y install libgnustep-base-dev libz-dev libbz2-dev
libgnustep-base-dev libz-dev libbz2-dev \ sudo apt-get -y install libssl-dev libicu-dev unzip
libssl-dev libicu-dev unzip
sudo apt-get clean sudo apt-get clean
rm -rf /tmp/unar &> /dev/null rm -rf /tmp/unar &> /dev/null
mkdir /tmp/unar mkdir /tmp/unar
cd /tmp/unar cd /tmp/unar
wget -qO unar1.9_src.zip http://unarchiver.c3.cx/downloads/unar1.9.1_src.zip wget -qO unar1.7_src.zip http://theunarchiver.googlecode.com/files/unar1.7_src.zip
unzip -o unar1.9_src.zip unzip -o unar1.7_src.zip
cd The\ Unarchiver/XADMaster cd The\ Unarchiver/XADMaster
make -f Makefile.linux make -f Makefile.linux
sudo mv lsar unar /usr/local/bin sudo mv lsar unar /usr/local/bin
@@ -123,7 +121,7 @@ sudo wget -q -O /usr/local/etc/a2server-help.txt "${scriptURL}scripts/tools/a2se
sudo wget -q -O /usr/local/etc/a2server-aliases "${scriptURL}scripts/tools/a2server-aliases.txt" sudo wget -q -O /usr/local/etc/a2server-aliases "${scriptURL}scripts/tools/a2server-aliases.txt"
grep a2server-aliases /etc/bash.bashrc > /dev/null || \ grep a2server-aliases /etc/bash.bashrc > /dev/null || \
echo "source /usr/local/etc/a2server-aliases" | sudo tee -a /etc/bash.bashrc > /dev/null echo "source /usr/local/etc/a2server-aliases" | sudo tee -a /etc/bash.bashrc > /dev/null
[[ $(lsb_release -d 2> /dev/null | grep Ubuntu) ]] && motd="/etc/issue" || motd="/etc/motd" [[ $(lsb_release -d 2> /dev/null | grep Ubuntu) ]] && motd="/etc/issue" || motd="/etc/motd"
if [[ ! $(grep A2SERVER $motd) ]]; then if [[ ! $(grep A2SERVER $motd) ]]; then

View File

@@ -27,52 +27,18 @@ protermDir=$commDir/PROTERM
zlinkDir=$commDir/Z.LINK zlinkDir=$commDir/Z.LINK
adtproDir=$commDir/ADTPRO adtproDir=$commDir/ADTPRO
function askYesNo()
# Ask a yes/no question of the user, with potential default
# arg1: Prompt text
# arg2: Default; 0 for yes, 1 for no, anything else for no default
# arg3: Info text for the user
# returns: 0 for yes, 1 for no
{
local default
case "$2" in
0) default="y" ;;
1) default="n" ;;
*) default="" ;;
esac
if [ -n "$autoAnswerDefault" -a -n "$default" ]; then
return $2
fi
if [ -n "$3" ]; then
echo
echo "$3"
echo
fi
while :; do
echo -n "$1 "
[ -n "$default" ] && echo -n "[$default] "
read
case "$REPLY" in
[Yy]*) return 0 ;;
[Nn]*) return 1 ;;
"") [ -n "$default" ] && return $2 ;;
*) echo "Please answer yes or no." ;;
esac
done
}
# bail out on automated netboot setup unless -b is also specified # bail out on automated netboot setup unless -b is also specified
[[ -f /tmp/a2server-autoAnswerDefault ]] && autoAnswerDefault=1 || autoAnswerDefault= [[ -f /tmp/a2server-autoAnswerYes ]] && autoAnswerYes=1 || autoAnswerYes=
if [[ ! $autoAnswerDefault || -f /tmp/a2server-setupNetBoot ]]; then if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
askYesNo "Configure Apple II network boot?" 0 \ if [[ ! $autoAnswerYes ]]; then
"Your Apple II computers can boot directly via the network echo
if ProDOS and/or GS/OS are installed onto A2SERVER." echo "Do you want to set up A2SERVER to be able to boot Apple II"
echo -n "computers over the network? "
read
fi
if [ $? -eq 0 ]; then if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
nbmode=1 nbmode=1
echo echo
@@ -161,12 +127,12 @@ if ProDOS and/or GS/OS are installed onto A2SERVER."
echo "A2SERVER: GS/OS has already been downloaded and installed." echo "A2SERVER: GS/OS has already been downloaded and installed."
gsosInstall=1 gsosInstall=1
else else
askYesNo "Download and install GS/OS now?" 0 \ if [[ ! $autoAnswerYes ]]; then
"You can opt to download and install GS/OS 6.0.1 now to you echo "You can set up GS/OS 6.0.1 on your network drive, for network boot."
network drive in order to boot GS/OS on Apple IIgs systems. echo -n "This may take a while. Download and install it now? "
This may take some time, particularly if you have a slower read
network connection." fi
if [ $? -eq 0 ]; then if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
gsosInstall=1 gsosInstall=1
# get GS/OS disks from Internet Archive and put them in IMAGES # get GS/OS disks from Internet Archive and put them in IMAGES
@@ -258,15 +224,13 @@ network connection."
fi fi
fi fi
askYesNo "Install GS/OS image/archive tools?" 0 \ if [[ ! $autoAnswerYes ]]; then
"GS/OS tools may be installed for working with disk images echo
and Apple II archives. At the moment, these include: echo "Do you want to download and install utilities for working with"
echo -n "disk images and archive files in GS/OS? "
- Asimov 2.0 read
- GS-ShrinkIt 1.1 fi
- MountIt 1.4" if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
if [ $? -eq 0 ]; then
# download image tools and put them in IMAGE.TOOLS # download image tools and put them in IMAGE.TOOLS
echo "A2SERVER: Downloading GS/OS disk image utilities..." echo "A2SERVER: Downloading GS/OS disk image utilities..."
@@ -317,15 +281,13 @@ and Apple II archives. At the moment, these include:
fi fi
fi fi
askYesNo "Install ProDOS image/archive tools?" 0 \ if [[ ! $autoAnswerYes ]]; then
"ProDOS tools may be installed for working with disk images echo
and Apple II archives. At the moment, these include: echo "Do you want to download and install utilities for working with"
echo -n "disk images and archive files in ProDOS 8? "
- ShrinkIt 3.4 read
- DSK2FILE 5.8 fi
- Apple System Utilities 3.1" if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
if [ $? -eq 0 ]; then
echo "A2SERVER: Downloading ProDOS 8 disk image utilities..." echo "A2SERVER: Downloading ProDOS 8 disk image utilities..."
@@ -378,26 +340,13 @@ and Apple II archives. At the moment, these include:
fi fi
askYesNo "Install communications software?" 0 \ if [[ ! $autoAnswerYes ]]; then
"Communications software (a terminal program) allows you echo
to connect to A2CLOUD, use analog modems for dialup BBS echo "Do you want to download serial communications software for"
access, and connect to other computers. echo -n "GS/OS and ProDOS 8? "
read
For the Apple IIgs, Spectrum provides a terminal and fi
Internet access options. if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
Finally, ADTPro allows you to transfer disk images to
and from remote computers, as well as to mount remote
disk images over serial port via the VSDRIVE program.
Answer yes to install:
- Spectrum 2.53
- ProTERM 3.1
- Z-Link 91.12.15
- ADTPro and VSDRIVE"
if [ $? -eq 0 ]; then
echo "A2SERVER: Downloading communications software..." echo "A2SERVER: Downloading communications software..."
@@ -473,13 +422,13 @@ Answer yes to install:
fi fi
askYesNo "Download and patch GS/OS for the Farallon bridge?" 0 \ if [[ ! $autoAnswerYes ]]; then
"There is a bug between the Farallon LocalTalk-to-Ethernet bridge echo
and the Apple IIgs which causes the system to freeze. GS/OS can echo "Do you want to download the patch required for using"
be patched to work around the issue, but the bug will persist if echo -n "a Farallon LocalTalk-to-Ethernet bridge with GS/OS? "
you boot directly into ProDOS 8 on a IIgs. Apple IIe users are read
not affected by this bug at all." fi
if [ $? -eq 0 ]; then if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
echo "A2SERVER: Downloading Farallon bridge patch..." echo "A2SERVER: Downloading Farallon bridge patch..."
wget -O /tmp/FARALLON.PO "http://appleii.ivanx.com/a2server/files/FARALLON.B1.PO" &> /dev/null wget -O /tmp/FARALLON.PO "http://appleii.ivanx.com/a2server/files/FARALLON.B1.PO" &> /dev/null
if [[ -d $gsosDir/SYSTEM/SYSTEM.SETUP ]]; then if [[ -d $gsosDir/SYSTEM/SYSTEM.SETUP ]]; then
@@ -493,6 +442,10 @@ not affected by this bug at all."
echo "SYSTEM.SETUP folder of the SYSTEM folder of your GSOS startup disk," echo "SYSTEM.SETUP folder of the SYSTEM folder of your GSOS startup disk,"
echo "or, if you can't, download the patch from the A2SERVER web site." echo "or, if you can't, download the patch from the A2SERVER web site."
fi fi
echo
echo "Note: Farallon bridges can only be used in GS/OS (with this patch)"
echo "and Apple IIe computers. Apple IIgs computers which network boot"
echo "directly into ProDOS 8 will freeze after a few minutes."
fi fi
fi fi

View File

@@ -4,52 +4,16 @@
# Set up A2SERVER to support Samba (Windows File Sharing) # Set up A2SERVER to support Samba (Windows File Sharing)
# this script can also be used if new shares are introduced # this script can also be used if new shares are introduced
function askYesNo() [[ -f /tmp/a2server-autoAnswerYes ]] && autoAnswerYes=1 || autoAnswerYes=
# Ask a yes/no question of the user, with potential default
# arg1: Prompt text
# arg2: Default; 0 for yes, 1 for no, anything else for no default
# arg3: Info text for the user
# returns: 0 for yes, 1 for no
{
local default
case "$2" in if [[ ! $autoAnswerYes || -f /tmp/a2server-setupWindowsSharing ]]; then
0) default="y" ;;
1) default="n" ;;
*) default="" ;;
esac
if [ -n "$autoAnswerDefault" -a -n "$default" ]; then if [[ ! $autoAnswerYes ]]; then
return $2
fi
if [ -n "$3" ]; then
echo echo
echo "$3" echo -n "Should Windows computers be able to connect to A2SERVER? "
echo
fi
while :; do
echo -n "$1 "
[ -n "$default" ] && echo -n "[$default] "
read read
case "$REPLY" in
[Yy]*) return 0 ;;
[Nn]*) return 1 ;;
"") [ -n "$default" ] && return $2 ;;
*) echo "Please answer yes or no." ;;
esac
done
}
[[ -f /tmp/a2server-autoAnswerDefault ]] && autoAnswerDefault=1 || autoAnswerDefault=
if [[ ! $autoAnswerDefault || -f /tmp/a2server-setupWindowsSharing ]]; then
if [[ ! $autoAnswerDefault ]]; then
echo
askYesNo "Should Windows computers be able to connect to A2SERVER?" 0
fi fi
if [ $? -eq 0 ]; then if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
echo "A2SERVER: Setting up Windows file sharing..." echo "A2SERVER: Setting up Windows file sharing..."
sudo true sudo true
@@ -84,7 +48,7 @@ if [[ ! $autoAnswerDefault || -f /tmp/a2server-setupWindowsSharing ]]; then
workgroup=$(grep -o "^ workgroup = .*$" /etc/samba/smb.conf 2> /dev/null | cut -c 16-) workgroup=$(grep -o "^ workgroup = .*$" /etc/samba/smb.conf 2> /dev/null | cut -c 16-)
[[ $workgroup ]] || workgroup="WORKGROUP" [[ $workgroup ]] || workgroup="WORKGROUP"
if [[ ! $autoAnswerDefault ]]; then if [[ ! $autoAnswerYes ]]; then
echo echo
echo "Enter workgroup name (or press return for '${workgroup}'): " echo "Enter workgroup name (or press return for '${workgroup}'): "
read read

View File

@@ -5,43 +5,6 @@
# This script helps when running on the Linux console within the VM. # This script helps when running on the Linux console within the VM.
function askYesNo()
# Ask a yes/no question of the user, with potential default
# arg1: Prompt text
# arg2: Default; 0 for yes, 1 for no, anything else for no default
# arg3: Info text for the user
# returns: 0 for yes, 1 for no
{
local default
case "$2" in
0) default="y" ;;
1) default="n" ;;
*) default="" ;;
esac
if [ -n "$autoAnswerDefault" -a -n "$default" ]; then
return $2
fi
if [ -n "$3" ]; then
echo
echo "$3"
echo
fi
while :; do
echo -n "$1 "
[ -n "$default" ] && echo -n "[$default] "
read
case "$REPLY" in
[Yy]*) return 0 ;;
[Nn]*) return 1 ;;
"") [ -n "$default" ] && return $2 ;;
*) echo "Please answer yes or no." ;;
esac
done
}
echo echo
userPw=$(sudo grep "^$USER" /etc/shadow | cut -f 2 -d ':') userPw=$(sudo grep "^$USER" /etc/shadow | cut -f 2 -d ':')
@@ -79,16 +42,19 @@ if [[ $(lsb_release -d 2> /dev/null | grep Ubuntu) ]]; then
echo "A2SERVER: Ubuntu console has already been optimized." echo "A2SERVER: Ubuntu console has already been optimized."
else else
askYesNo "Do you want to optimize the Ubuntu console?" 0 \ echo "Ubuntu console optimization for use in a virtual machine will:"
"Ubuntu console optimization for use in a virtual machine will: echo "- show the default username/password on the login screen"
- show the default username/password on the login screen echo "- remove the documentation URL and system statistics shown after login"
- remove the documentation URL and system statistics shown after login echo "- ensure the screen clears before showing the login prompt"
- ensure the screen clears before showing the login prompt echo "- prevent the screen from dimming after 10 minutes (once logged in)"
- prevent the screen from dimming after 10 minutes (once logged in) echo "- eliminate a harmless but annoying startup error about piix_smbus"
- eliminate a harmless but annoying startup error about piix_smbus echo "- fix an Ubuntu 10.04 issue with slow scrolling"
- fix an Ubuntu 10.04 issue with slow scrolling" echo
if [[ ! $autoAnswerYes ]]; then
if [ $? -eq 0 ]; then echo -n "Do you want to optimize the Ubuntu console? "
read
fi
if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
echo "A2SERVER: Optimizing console..." echo "A2SERVER: Optimizing console..."

View File

@@ -11,43 +11,6 @@
a2serverVersion="125" a2serverVersion="125"
function askYesNo()
# Ask a yes/no question of the user, with potential default
# arg1: Prompt text
# arg2: Default; 0 for yes, 1 for no, anything else for no default
# arg3: Info text for the user
# returns: 0 for yes, 1 for no
{
local default
case "$2" in
0) default="y" ;;
1) default="n" ;;
*) default="" ;;
esac
if [ -n "$autoAnswerDefault" -a -n "$default" ]; then
return $2
fi
if [ -n "$3" ]; then
echo
echo "$3"
echo
fi
while :; do
echo -n "$1 "
[ -n "$default" ] && echo -n "[$default] "
read
case "$REPLY" in
[Yy]*) return 0 ;;
[Nn]*) return 1 ;;
"") [ -n "$default" ] && return $2 ;;
*) echo "Please answer yes or no." ;;
esac
done
}
# Ensure URL we'll use ends in a / # Ensure URL we'll use ends in a /
case "$A2SERVER_SCRIPT_URL" in case "$A2SERVER_SCRIPT_URL" in
*/) scriptURL="$A2SERVER_SCRIPT_URL" ;; */) scriptURL="$A2SERVER_SCRIPT_URL" ;;
@@ -66,7 +29,7 @@ if [[ -f /usr/local/etc/A2SERVER-version ]]; then
fi fi
skipRepoUpdate= skipRepoUpdate=
autoAnswerDefault= autoAnswerYes=
setupNetBoot= setupNetBoot=
setupWindowsSharing= setupWindowsSharing=
updateRasppleII= updateRasppleII=
@@ -77,8 +40,8 @@ while [[ $1 ]]; do
touch /tmp/a2server-packageReposUpdated touch /tmp/a2server-packageReposUpdated
elif [[ $1 == "-y" ]]; then elif [[ $1 == "-y" ]]; then
shift shift
autoAnswerDefault="-y" autoAnswerYes="-y"
touch /tmp/a2server-autoAnswerDefault touch /tmp/a2server-autoAnswerYes
elif [[ $1 == "-b" ]]; then elif [[ $1 == "-b" ]]; then
shift shift
setupNetBoot="-b" setupNetBoot="-b"
@@ -101,7 +64,7 @@ while [[ $1 ]]; do
elif [[ $1 ]]; then elif [[ $1 ]]; then
echo "options:" echo "options:"
echo "-v: display installed and available versions, then exit" echo "-v: display installed and available versions, then exit"
echo "-y: auto-answer default to all prompts" echo "-y: auto-answer yes to all prompts"
echo "-r: don't update package repositories" echo "-r: don't update package repositories"
echo "-b: auto-setup network boot (use with -y)" echo "-b: auto-setup network boot (use with -y)"
echo "-w: auto-setup Windows file sharing (use with -y)" echo "-w: auto-setup Windows file sharing (use with -y)"
@@ -151,18 +114,28 @@ fi
doSetup=1 doSetup=1
if [[ ! -f /usr/local/etc/a2server-help.txt ]] || (( $a2server_update )); then if [[ ! -f /usr/local/etc/a2server-help.txt ]] || (( $a2server_update )); then
askYesNo "Ready to set up A2SERVER?" 0 \ echo
"Setting up A2SERVER will take up to 60 minutes, during which echo "Setting up A2SERVER will take up to 60 minutes, during which"
you'll see a bunch of stuff spit out across the screen." echo "you'll see a bunch of stuff spit out across the screen."
doSetup=$(( 1 - $? )) echo
if [[ ! $autoAnswerYes ]]; then
echo -n "Ready to set up A2SERVER? "
read
[[ ${REPLY:0:1} == "y" || ${REPLY:0:1} == "Y" ]]; doSetup=$(( 1 - $? ))
fi
fi fi
if (( $doSetup )); then if (( $doSetup )); then
askYesNo "Continue?" 0 \ echo
"a2server-setup modifies files and performs actions as the root user. echo "a2server-setup modifies files and performs actions as the root user."
For details, visit http://appleii.ivanx.com/a2server." echo "For details, visit http://appleii.ivanx.com/a2server."
doSetup=$(( 1 - $? )) echo
if [[ ! $autoAnswerYes ]]; then
echo -n "Continue? "
read
[[ ${REPLY:0:1} == "y" || ${REPLY:0:1} == "Y" ]]; doSetup=$(( 1 - $? ))
fi
if (( $doSetup )); then if (( $doSetup )); then
@@ -177,11 +150,16 @@ For details, visit http://appleii.ivanx.com/a2server."
[[ $isRpi ]] && a2server="your Raspberry Pi" || a2server="A2SERVER" [[ $isRpi ]] && a2server="your Raspberry Pi" || a2server="A2SERVER"
if [[ ! $isApple2Pw && ! -f /usr/local/etc/A2SERVER-version ]]; then if [[ ! $isApple2Pw && ! -f /usr/local/etc/A2SERVER-version ]]; then
askYesNo "Do you want to change the password for user \"$USER\" to \"apple2\" now?" 0 \ if [[ ! $autoAnswerYes ]]; then
"To ensure that all client computers are able to connect to echo
${a2server} using the same password, you are recommended echo "To ensure that all client computers are able to connect to"
to change your user password to \"apple2\"." echo "${a2server} using the same password, you are recommended"
if [ $? -eq 0 ]; then echo "to change your user password to 'apple2'."
echo
echo -n "Do you want to change the password for user '$USER' to 'apple2' now? "
read
fi
if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
echo "A2SERVER: changing password for user '$USER' to 'apple2'..." echo "A2SERVER: changing password for user '$USER' to 'apple2'..."
echo "$USER:apple2" | sudo chpasswd echo "$USER:apple2" | sudo chpasswd
fi fi
@@ -253,10 +231,14 @@ to change your user password to \"apple2\"."
echo "A2SERVER setup is complete! Go connect from your Apple II!" echo "A2SERVER setup is complete! Go connect from your Apple II!"
echo echo
elif [[ -f /tmp/rpiUpdate ]]; then elif [[ -f /tmp/rpiUpdate ]]; then
askYesNo "Restart now?" 0 \ echo "A2SERVER is now configured, but Apple II clients will not be able"
"A2SERVER is now configured, but Apple II clients will not be able echo "to connect until you restart your Raspberry Pi."
to connect until you restart your Raspberry Pi." echo
if [ $? -eq 0 ]; then if [[ ! $autoAnswerYes ]]; then
echo -n "Restart now? "
read
fi
if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
sudo shutdown -r now sudo shutdown -r now
echo echo
echo "A2SERVER: Preparing to restart..." echo "A2SERVER: Preparing to restart..."
@@ -282,9 +264,12 @@ to connect until you restart your Raspberry Pi."
fi fi
if [[ -f /tmp/singleUser ]]; then if [[ -f /tmp/singleUser ]]; then
askYesNo "Restart now?" 0 \ if [[ ! $autoAnswerYes ]]; then
"Your Raspberry Pi was started in single-user mode in order tofix a problem. You should restart to operate normally." echo "Your Raspberry Pi was started in single-user mode in order to"
if [ $? -eq 0 ]; then echo -n "fix a problem. You should restart to operate normally. Restart now? "
read
fi
if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
sudo shutdown -r now sudo shutdown -r now
echo echo
echo "A2SERVER: Preparing to restart..." echo "A2SERVER: Preparing to restart..."
@@ -302,7 +287,7 @@ fi
unset a2server_update 2> /dev/null unset a2server_update 2> /dev/null
unset doSetup 2> /dev/null unset doSetup 2> /dev/null
rm /tmp/a2server-autoAnswerDefault 2> /dev/null rm /tmp/a2server-autoAnswerYes 2> /dev/null
rm /tmp/a2server-packageReposUpdated 2> /dev/null rm /tmp/a2server-packageReposUpdated 2> /dev/null
rm /tmp/a2server-setupNetBoot 2> /dev/null rm /tmp/a2server-setupNetBoot 2> /dev/null
rm /tmp/a2server-setupWindowsSharing 2> /dev/null rm /tmp/a2server-setupWindowsSharing 2> /dev/null

View File

@@ -3,43 +3,6 @@
currentVersion=125 currentVersion=125
function askYesNo()
# Ask a yes/no question of the user, with potential default
# arg1: Prompt text
# arg2: Default; 0 for yes, 1 for no, anything else for no default
# arg3: Info text for the user
# returns: 0 for yes, 1 for no
{
local default
case "$2" in
0) default="y" ;;
1) default="n" ;;
*) default="" ;;
esac
if [ -n "$autoAnswerDefault" -a -n "$default" ]; then
return $2
fi
if [ -n "$3" ]; then
echo
echo "$3"
echo
fi
while :; do
echo -n "$1 "
[ -n "$default" ] && echo -n "[$default] "
read
case "$REPLY" in
[Yy]*) return 0 ;;
[Nn]*) return 1 ;;
"") [ -n "$default" ] && return $2 ;;
*) echo "Please answer yes or no." ;;
esac
done
}
if [[ -f /usr/local/etc/A2SERVER-version ]]; then if [[ -f /usr/local/etc/A2SERVER-version ]]; then
installedVersion=$(cat /usr/local/etc/A2SERVER-version) installedVersion=$(cat /usr/local/etc/A2SERVER-version)
else else
@@ -52,10 +15,10 @@ case "$A2SERVER_SCRIPT_URL" in
*) scriptURL="${A2SERVER_SCRIPT_URL:-http://appleii.ivanx.com/a2server}/" ;; *) scriptURL="${A2SERVER_SCRIPT_URL:-http://appleii.ivanx.com/a2server}/" ;;
esac esac
autoAnswerDefault= autoAnswerYes=
for arg in $@; do for arg in $@; do
if [[ $arg == "-y" ]]; then if [[ $arg == "-y" ]]; then
autoAnswerDefault=1 autoAnswerYes=1
break break
fi fi
done done
@@ -63,12 +26,17 @@ done
echo echo
echo "Update history:" echo "Update history:"
wget -qO- "${scriptURL}update/versionhistory.txt" wget -qO- "${scriptURL}update/versionhistory.txt"
echo
askYesNo "Do you want to update (or reinstall) A2SERVER?" 0 \ echo "installed version: ${installedVersion:0:1}.${installedVersion:1:1}.${installedVersion:2:1}"
"installed version: ${installedVersion:0:1}.${installedVersion:1:1}.${installedVersion:2:1} echo "current version: ${currentVersion:0:1}.${currentVersion:1:1}.${currentVersion:2:1}"
current version: ${currentVersion:0:1}.${currentVersion:1:1}.${currentVersion:2:1}" echo
if [[ $autoAnswerYes ]]; then
if [ $? = 0 ]; then REPLY="y"
else
echo -n "Do you want to update (or reinstall) A2SERVER? "
read
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/A2SERVER-version &> /dev/null
# sudo rm /usr/local/etc/netatalk/a2boot/* &> /dev/null # sudo rm /usr/local/etc/netatalk/a2boot/* &> /dev/null
wget -q -O /tmp/setup "${scriptURL}setup"; source /tmp/setup "$@" wget -q -O /tmp/setup "${scriptURL}setup"; source /tmp/setup "$@"