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
fi
:<<COMMENT
if [[ $isRpi || $isDebian ]]; then
sudo apt-get -y install libgnustep-base1.22
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
fi
fi
COMMENT
if [[ ! -f /usr/local/bin/unar || "`/usr/local/bin/unar -v`" != "v1.9.1" ]]; then
sudo apt-get -y install build-essential \
libgnustep-base-dev libz-dev libbz2-dev \
libssl-dev libicu-dev unzip
if [[ ! -f /usr/local/bin/unar ]]; then
sudo apt-get -y install build-essential
sudo apt-get -y install libgnustep-base-dev libz-dev libbz2-dev
sudo apt-get -y install libssl-dev libicu-dev unzip
sudo apt-get clean
rm -rf /tmp/unar &> /dev/null
mkdir /tmp/unar
cd /tmp/unar
wget -qO unar1.9_src.zip http://unarchiver.c3.cx/downloads/unar1.9.1_src.zip
unzip -o unar1.9_src.zip
wget -qO unar1.7_src.zip http://theunarchiver.googlecode.com/files/unar1.7_src.zip
unzip -o unar1.7_src.zip
cd The\ Unarchiver/XADMaster
make -f Makefile.linux
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"
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"
if [[ ! $(grep A2SERVER $motd) ]]; then

View File

@ -27,52 +27,18 @@ protermDir=$commDir/PROTERM
zlinkDir=$commDir/Z.LINK
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
[[ -f /tmp/a2server-autoAnswerDefault ]] && autoAnswerDefault=1 || autoAnswerDefault=
if [[ ! $autoAnswerDefault || -f /tmp/a2server-setupNetBoot ]]; then
[[ -f /tmp/a2server-autoAnswerYes ]] && autoAnswerYes=1 || autoAnswerYes=
if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
askYesNo "Configure Apple II network boot?" 0 \
"Your Apple II computers can boot directly via the network
if ProDOS and/or GS/OS are installed onto A2SERVER."
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 [ $? -eq 0 ]; then
if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
nbmode=1
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."
gsosInstall=1
else
askYesNo "Download and install GS/OS now?" 0 \
"You can opt to download and install GS/OS 6.0.1 now to you
network drive in order to boot GS/OS on Apple IIgs systems.
This may take some time, particularly if you have a slower
network connection."
if [ $? -eq 0 ]; then
if [[ ! $autoAnswerYes ]]; then
echo "You can set up GS/OS 6.0.1 on your network drive, for network boot."
echo -n "This may take a while. Download and install it now? "
read
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
@ -258,15 +224,13 @@ network connection."
fi
fi
askYesNo "Install GS/OS image/archive tools?" 0 \
"GS/OS tools may be installed for working with disk images
and Apple II archives. At the moment, these include:
- Asimov 2.0
- GS-ShrinkIt 1.1
- MountIt 1.4"
if [ $? -eq 0 ]; then
if [[ ! $autoAnswerYes ]]; then
echo
echo "Do you want to download and install utilities for working with"
echo -n "disk images and archive files in GS/OS? "
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..."
@ -317,15 +281,13 @@ and Apple II archives. At the moment, these include:
fi
fi
askYesNo "Install ProDOS image/archive tools?" 0 \
"ProDOS tools may be installed for working with disk images
and Apple II archives. At the moment, these include:
- ShrinkIt 3.4
- DSK2FILE 5.8
- Apple System Utilities 3.1"
if [ $? -eq 0 ]; then
if [[ ! $autoAnswerYes ]]; then
echo
echo "Do you want to download and install utilities for working with"
echo -n "disk images and archive files in ProDOS 8? "
read
fi
if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
echo "A2SERVER: Downloading ProDOS 8 disk image utilities..."
@ -378,26 +340,13 @@ and Apple II archives. At the moment, these include:
fi
askYesNo "Install communications software?" 0 \
"Communications software (a terminal program) allows you
to connect to A2CLOUD, use analog modems for dialup BBS
access, and connect to other computers.
For the Apple IIgs, Spectrum provides a terminal and
Internet access options.
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
if [[ ! $autoAnswerYes ]]; then
echo
echo "Do you want to download serial communications software for"
echo -n "GS/OS and ProDOS 8? "
read
fi
if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
echo "A2SERVER: Downloading communications software..."
@ -473,13 +422,13 @@ Answer yes to install:
fi
askYesNo "Download and patch GS/OS for the Farallon bridge?" 0 \
"There is a bug between the Farallon LocalTalk-to-Ethernet bridge
and the Apple IIgs which causes the system to freeze. GS/OS can
be patched to work around the issue, but the bug will persist if
you boot directly into ProDOS 8 on a IIgs. Apple IIe users are
not affected by this bug at all."
if [ $? -eq 0 ]; then
if [[ ! $autoAnswerYes ]]; then
echo
echo "Do you want to download the patch required for using"
echo -n "a Farallon LocalTalk-to-Ethernet bridge with GS/OS? "
read
fi
if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
echo "A2SERVER: Downloading Farallon bridge patch..."
wget -O /tmp/FARALLON.PO "http://appleii.ivanx.com/a2server/files/FARALLON.B1.PO" &> /dev/null
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 "or, if you can't, download the patch from the A2SERVER web site."
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

View File

@ -4,52 +4,16 @@
# Set up A2SERVER to support Samba (Windows File Sharing)
# this script can also be used if new shares are introduced
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
[[ -f /tmp/a2server-autoAnswerYes ]] && autoAnswerYes=1 || autoAnswerYes=
case "$2" in
0) default="y" ;;
1) default="n" ;;
*) default="" ;;
esac
if [[ ! $autoAnswerYes || -f /tmp/a2server-setupWindowsSharing ]]; then
if [ -n "$autoAnswerDefault" -a -n "$default" ]; then
return $2
fi
if [ -n "$3" ]; then
if [[ ! $autoAnswerYes ]]; then
echo
echo "$3"
echo
fi
while :; do
echo -n "$1 "
[ -n "$default" ] && echo -n "[$default] "
echo -n "Should Windows computers be able to connect to A2SERVER? "
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
if [ $? -eq 0 ]; then
if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
echo "A2SERVER: Setting up Windows file sharing..."
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 ]] || workgroup="WORKGROUP"
if [[ ! $autoAnswerDefault ]]; then
if [[ ! $autoAnswerYes ]]; then
echo
echo "Enter workgroup name (or press return for '${workgroup}'): "
read

View File

@ -5,43 +5,6 @@
# 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
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."
else
askYesNo "Do you want to optimize the Ubuntu console?" 0 \
"Ubuntu console optimization for use in a virtual machine will:
- show the default username/password on the login screen
- remove the documentation URL and system statistics shown after login
- ensure the screen clears before showing the login prompt
- prevent the screen from dimming after 10 minutes (once logged in)
- eliminate a harmless but annoying startup error about piix_smbus
- fix an Ubuntu 10.04 issue with slow scrolling"
if [ $? -eq 0 ]; then
echo "Ubuntu console optimization for use in a virtual machine will:"
echo "- show the default username/password on the login screen"
echo "- remove the documentation URL and system statistics shown after login"
echo "- ensure the screen clears before showing the login prompt"
echo "- prevent the screen from dimming after 10 minutes (once logged in)"
echo "- eliminate a harmless but annoying startup error about piix_smbus"
echo "- fix an Ubuntu 10.04 issue with slow scrolling"
echo
if [[ ! $autoAnswerYes ]]; 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..."

View File

@ -11,47 +11,10 @@
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 /
case "$A2SERVER_SCRIPT_URL" in
*/) scriptURL="$A2SERVER_SCRIPT_URL" ;;
*) scriptURL="${A2SERVER_SCRIPT_URL:-http://appleii.ivanx.com/a2server}/" ;;
*/) scriptURL="$A2SERVER_SCRIPT_URL" ;;
*) scriptURL="${A2SERVER_SCRIPT_URL:-http://appleii.ivanx.com/a2server}/" ;;
esac
isRpi=
@ -66,7 +29,7 @@ if [[ -f /usr/local/etc/A2SERVER-version ]]; then
fi
skipRepoUpdate=
autoAnswerDefault=
autoAnswerYes=
setupNetBoot=
setupWindowsSharing=
updateRasppleII=
@ -77,8 +40,8 @@ while [[ $1 ]]; do
touch /tmp/a2server-packageReposUpdated
elif [[ $1 == "-y" ]]; then
shift
autoAnswerDefault="-y"
touch /tmp/a2server-autoAnswerDefault
autoAnswerYes="-y"
touch /tmp/a2server-autoAnswerYes
elif [[ $1 == "-b" ]]; then
shift
setupNetBoot="-b"
@ -101,7 +64,7 @@ while [[ $1 ]]; do
elif [[ $1 ]]; then
echo "options:"
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 "-b: auto-setup network boot (use with -y)"
echo "-w: auto-setup Windows file sharing (use with -y)"
@ -151,18 +114,28 @@ fi
doSetup=1
if [[ ! -f /usr/local/etc/a2server-help.txt ]] || (( $a2server_update )); then
askYesNo "Ready to set up A2SERVER?" 0 \
"Setting up A2SERVER will take up to 60 minutes, during which
you'll see a bunch of stuff spit out across the screen."
doSetup=$(( 1 - $? ))
echo
echo "Setting up A2SERVER will take up to 60 minutes, during which"
echo "you'll see a bunch of stuff spit out across the screen."
echo
if [[ ! $autoAnswerYes ]]; then
echo -n "Ready to set up A2SERVER? "
read
[[ ${REPLY:0:1} == "y" || ${REPLY:0:1} == "Y" ]]; doSetup=$(( 1 - $? ))
fi
fi
if (( $doSetup )); then
askYesNo "Continue?" 0 \
"a2server-setup modifies files and performs actions as the root user.
For details, visit http://appleii.ivanx.com/a2server."
doSetup=$(( 1 - $? ))
echo
echo "a2server-setup modifies files and performs actions as the root user."
echo "For details, visit http://appleii.ivanx.com/a2server."
echo
if [[ ! $autoAnswerYes ]]; then
echo -n "Continue? "
read
[[ ${REPLY:0:1} == "y" || ${REPLY:0:1} == "Y" ]]; doSetup=$(( 1 - $? ))
fi
if (( $doSetup )); then
@ -177,11 +150,16 @@ For details, visit http://appleii.ivanx.com/a2server."
[[ $isRpi ]] && a2server="your Raspberry Pi" || a2server="A2SERVER"
if [[ ! $isApple2Pw && ! -f /usr/local/etc/A2SERVER-version ]]; then
askYesNo "Do you want to change the password for user \"$USER\" to \"apple2\" now?" 0 \
"To ensure that all client computers are able to connect to
${a2server} using the same password, you are recommended
to change your user password to \"apple2\"."
if [ $? -eq 0 ]; then
if [[ ! $autoAnswerYes ]]; then
echo
echo "To ensure that all client computers are able to connect to"
echo "${a2server} using the same password, you are recommended"
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 "$USER:apple2" | sudo chpasswd
fi
@ -253,10 +231,14 @@ to change your user password to \"apple2\"."
echo "A2SERVER setup is complete! Go connect from your Apple II!"
echo
elif [[ -f /tmp/rpiUpdate ]]; then
askYesNo "Restart now?" 0 \
"A2SERVER is now configured, but Apple II clients will not be able
to connect until you restart your Raspberry Pi."
if [ $? -eq 0 ]; then
echo "A2SERVER is now configured, but Apple II clients will not be able"
echo "to connect until you restart your Raspberry Pi."
echo
if [[ ! $autoAnswerYes ]]; then
echo -n "Restart now? "
read
fi
if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
sudo shutdown -r now
echo
echo "A2SERVER: Preparing to restart..."
@ -282,9 +264,12 @@ to connect until you restart your Raspberry Pi."
fi
if [[ -f /tmp/singleUser ]]; then
askYesNo "Restart now?" 0 \
"Your Raspberry Pi was started in single-user mode in order tofix a problem. You should restart to operate normally."
if [ $? -eq 0 ]; then
if [[ ! $autoAnswerYes ]]; then
echo "Your Raspberry Pi was started in single-user mode in order to"
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
echo
echo "A2SERVER: Preparing to restart..."
@ -302,7 +287,7 @@ fi
unset a2server_update 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-setupNetBoot 2> /dev/null
rm /tmp/a2server-setupWindowsSharing 2> /dev/null

View File

@ -3,43 +3,6 @@
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
installedVersion=$(cat /usr/local/etc/A2SERVER-version)
else
@ -52,10 +15,10 @@ case "$A2SERVER_SCRIPT_URL" in
*) scriptURL="${A2SERVER_SCRIPT_URL:-http://appleii.ivanx.com/a2server}/" ;;
esac
autoAnswerDefault=
autoAnswerYes=
for arg in $@; do
if [[ $arg == "-y" ]]; then
autoAnswerDefault=1
autoAnswerYes=1
break
fi
done
@ -63,12 +26,17 @@ done
echo
echo "Update history:"
wget -qO- "${scriptURL}update/versionhistory.txt"
askYesNo "Do you want to update (or reinstall) A2SERVER?" 0 \
"installed version: ${installedVersion:0:1}.${installedVersion:1:1}.${installedVersion:2:1}
current version: ${currentVersion:0:1}.${currentVersion:1:1}.${currentVersion:2:1}"
if [ $? = 0 ]; then
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}"
echo
if [[ $autoAnswerYes ]]; 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/netatalk/a2boot/* &> /dev/null
wget -q -O /tmp/setup "${scriptURL}setup"; source /tmp/setup "$@"