2015-10-04 07:12:32 +00:00
|
|
|
#! /bin/bash
|
2015-10-09 12:29:32 +00:00
|
|
|
# vim: set tabstop=4 shiftwidth=4 expandtab filetype=sh:
|
2015-10-04 07:12:32 +00:00
|
|
|
|
2015-10-03 12:25:44 +00:00
|
|
|
# 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.
|
|
|
|
# more info is at http://appleii.ivanx.com/a2server
|
|
|
|
|
|
|
|
# to download and execute, type:
|
|
|
|
# wget appleii.ivanx.com/a2server/setup; source setup
|
|
|
|
|
2015-10-04 15:00:24 +00:00
|
|
|
a2serverVersion="125"
|
2015-10-03 12:25:44 +00:00
|
|
|
|
2015-10-08 21:07:46 +00:00
|
|
|
function askYesNo()
|
Make askYesNo use a here document for info text
The info text for askYesNo was a problem. First, it involved a long,
complex, paragraph encoded as string on the command line. That's NEVER
a good idea. Secondly, it passed that string unprocessed to printf
(albeit printf(1) but still) as a format string. And third, there's no
way to manage line length when you're doing that.
The alternative is to put the strings in a here document. We then cat
the result between a couple of empty echo commands to create the
original output. This addresses all of the above issues, but creates a
new one: The info text follows the prompt, rather than the other way
around. Not the most elegant.
So … why do this at all, why not just echo the info text outside of the
function, particularly since the function only echoes it once no matter
how many times you give a bogus answer? Well, if at some point we
decide to implement a dialog-type interface (whiptail, zenity, whatever
you prefer), then it becomes easy to do so. Unsure that's desirable at
this time, but options are good.
2015-10-12 09:59:42 +00:00
|
|
|
# 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
|
2015-10-12 23:56:43 +00:00
|
|
|
# arg3: Info text for the user
|
Make askYesNo use a here document for info text
The info text for askYesNo was a problem. First, it involved a long,
complex, paragraph encoded as string on the command line. That's NEVER
a good idea. Secondly, it passed that string unprocessed to printf
(albeit printf(1) but still) as a format string. And third, there's no
way to manage line length when you're doing that.
The alternative is to put the strings in a here document. We then cat
the result between a couple of empty echo commands to create the
original output. This addresses all of the above issues, but creates a
new one: The info text follows the prompt, rather than the other way
around. Not the most elegant.
So … why do this at all, why not just echo the info text outside of the
function, particularly since the function only echoes it once no matter
how many times you give a bogus answer? Well, if at some point we
decide to implement a dialog-type interface (whiptail, zenity, whatever
you prefer), then it becomes easy to do so. Unsure that's desirable at
this time, but options are good.
2015-10-12 09:59:42 +00:00
|
|
|
# returns: 0 for yes, 1 for no
|
2015-10-08 21:07:46 +00:00
|
|
|
{
|
2015-10-09 13:12:42 +00:00
|
|
|
local default
|
|
|
|
|
Make askYesNo use a here document for info text
The info text for askYesNo was a problem. First, it involved a long,
complex, paragraph encoded as string on the command line. That's NEVER
a good idea. Secondly, it passed that string unprocessed to printf
(albeit printf(1) but still) as a format string. And third, there's no
way to manage line length when you're doing that.
The alternative is to put the strings in a here document. We then cat
the result between a couple of empty echo commands to create the
original output. This addresses all of the above issues, but creates a
new one: The info text follows the prompt, rather than the other way
around. Not the most elegant.
So … why do this at all, why not just echo the info text outside of the
function, particularly since the function only echoes it once no matter
how many times you give a bogus answer? Well, if at some point we
decide to implement a dialog-type interface (whiptail, zenity, whatever
you prefer), then it becomes easy to do so. Unsure that's desirable at
this time, but options are good.
2015-10-12 09:59:42 +00:00
|
|
|
case "$2" in
|
2015-10-09 13:12:42 +00:00
|
|
|
0) default="y" ;;
|
|
|
|
1) default="n" ;;
|
|
|
|
*) default="" ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [ -n "$autoAnswerDefault" -a -n "$default" ]; then
|
Make askYesNo use a here document for info text
The info text for askYesNo was a problem. First, it involved a long,
complex, paragraph encoded as string on the command line. That's NEVER
a good idea. Secondly, it passed that string unprocessed to printf
(albeit printf(1) but still) as a format string. And third, there's no
way to manage line length when you're doing that.
The alternative is to put the strings in a here document. We then cat
the result between a couple of empty echo commands to create the
original output. This addresses all of the above issues, but creates a
new one: The info text follows the prompt, rather than the other way
around. Not the most elegant.
So … why do this at all, why not just echo the info text outside of the
function, particularly since the function only echoes it once no matter
how many times you give a bogus answer? Well, if at some point we
decide to implement a dialog-type interface (whiptail, zenity, whatever
you prefer), then it becomes easy to do so. Unsure that's desirable at
this time, but options are good.
2015-10-12 09:59:42 +00:00
|
|
|
return $2
|
2015-10-09 13:12:42 +00:00
|
|
|
fi
|
|
|
|
|
2015-10-12 23:56:43 +00:00
|
|
|
if [ -n "$3" ]; then
|
|
|
|
echo
|
|
|
|
echo "$3"
|
|
|
|
echo
|
|
|
|
fi
|
2015-10-09 13:12:42 +00:00
|
|
|
while :; do
|
Make askYesNo use a here document for info text
The info text for askYesNo was a problem. First, it involved a long,
complex, paragraph encoded as string on the command line. That's NEVER
a good idea. Secondly, it passed that string unprocessed to printf
(albeit printf(1) but still) as a format string. And third, there's no
way to manage line length when you're doing that.
The alternative is to put the strings in a here document. We then cat
the result between a couple of empty echo commands to create the
original output. This addresses all of the above issues, but creates a
new one: The info text follows the prompt, rather than the other way
around. Not the most elegant.
So … why do this at all, why not just echo the info text outside of the
function, particularly since the function only echoes it once no matter
how many times you give a bogus answer? Well, if at some point we
decide to implement a dialog-type interface (whiptail, zenity, whatever
you prefer), then it becomes easy to do so. Unsure that's desirable at
this time, but options are good.
2015-10-12 09:59:42 +00:00
|
|
|
echo -n "$1 "
|
2015-10-09 13:12:42 +00:00
|
|
|
[ -n "$default" ] && echo -n "[$default] "
|
|
|
|
read
|
|
|
|
case "$REPLY" in
|
|
|
|
[Yy]*) return 0 ;;
|
|
|
|
[Nn]*) return 1 ;;
|
Make askYesNo use a here document for info text
The info text for askYesNo was a problem. First, it involved a long,
complex, paragraph encoded as string on the command line. That's NEVER
a good idea. Secondly, it passed that string unprocessed to printf
(albeit printf(1) but still) as a format string. And third, there's no
way to manage line length when you're doing that.
The alternative is to put the strings in a here document. We then cat
the result between a couple of empty echo commands to create the
original output. This addresses all of the above issues, but creates a
new one: The info text follows the prompt, rather than the other way
around. Not the most elegant.
So … why do this at all, why not just echo the info text outside of the
function, particularly since the function only echoes it once no matter
how many times you give a bogus answer? Well, if at some point we
decide to implement a dialog-type interface (whiptail, zenity, whatever
you prefer), then it becomes easy to do so. Unsure that's desirable at
this time, but options are good.
2015-10-12 09:59:42 +00:00
|
|
|
"") [ -n "$default" ] && return $2 ;;
|
2015-10-09 13:12:42 +00:00
|
|
|
*) echo "Please answer yes or no." ;;
|
|
|
|
esac
|
|
|
|
done
|
2015-10-08 21:07:46 +00:00
|
|
|
}
|
|
|
|
|
2015-10-04 08:23:53 +00:00
|
|
|
# Ensure URL we'll use ends in a /
|
|
|
|
case "$A2SERVER_SCRIPT_URL" in
|
2015-10-09 13:12:42 +00:00
|
|
|
*/) scriptURL="$A2SERVER_SCRIPT_URL" ;;
|
|
|
|
*) scriptURL="${A2SERVER_SCRIPT_URL:-http://appleii.ivanx.com/a2server}/" ;;
|
2015-10-04 08:23:53 +00:00
|
|
|
esac
|
|
|
|
|
2015-10-03 12:25:44 +00:00
|
|
|
isRpi=
|
|
|
|
[[ -f /usr/bin/raspi-config ]] && isRpi=1
|
|
|
|
|
|
|
|
isDebian=
|
|
|
|
[[ ( -f /etc/debian_version ) && ( $(cut -c 1-2 < /etc/debian_version) == "7." ) && ( $(uname -m) == "i686" ) ]] && isDebian=1
|
|
|
|
|
|
|
|
skipRepoUpdate=
|
2015-10-08 19:51:54 +00:00
|
|
|
autoAnswerDefault=
|
2015-10-03 12:25:44 +00:00
|
|
|
setupNetBoot=
|
|
|
|
setupWindowsSharing=
|
|
|
|
updateRasppleII=
|
2015-10-17 03:10:10 +00:00
|
|
|
justShowVersion=
|
2015-10-03 12:25:44 +00:00
|
|
|
while [[ $1 ]]; do
|
|
|
|
if [[ $1 == "-r" ]]; then
|
|
|
|
shift
|
|
|
|
skipRepoUpdate="-r"
|
|
|
|
touch /tmp/a2server-packageReposUpdated
|
|
|
|
elif [[ $1 == "-y" ]]; then
|
|
|
|
shift
|
2015-10-08 19:51:54 +00:00
|
|
|
autoAnswerDefault="-y"
|
|
|
|
touch /tmp/a2server-autoAnswerDefault
|
2015-10-03 12:25:44 +00:00
|
|
|
elif [[ $1 == "-b" ]]; then
|
|
|
|
shift
|
|
|
|
setupNetBoot="-b"
|
|
|
|
touch /tmp/a2server-setupNetBoot
|
|
|
|
elif [[ $1 == "-w" ]]; then
|
|
|
|
shift
|
|
|
|
setupWindowsSharing="-w"
|
|
|
|
touch /tmp/a2server-setupWindowsSharing
|
|
|
|
elif [[ $1 == "-os" || $1 == "os" ]]; then
|
2015-10-09 12:29:32 +00:00
|
|
|
# elif [[ ${1,,} == "rasppleii" || ${1,,} == "raspple" || ${1,,} == "rasappleii" || ${1,,} == "rasapple" || ${1,,} == "raspple2" || ${1,,} == "rasapple2" ]]; then
|
2015-10-03 12:25:44 +00:00
|
|
|
shift
|
|
|
|
updateRasppleII=1
|
|
|
|
elif [[ $1 == "-v" ]]; then
|
2015-10-17 03:10:10 +00:00
|
|
|
justShowVersion=1
|
2015-10-03 12:25:44 +00:00
|
|
|
shift
|
|
|
|
elif [[ $1 ]]; then
|
|
|
|
echo "options:"
|
|
|
|
echo "-v: display installed and available versions, then exit"
|
2015-10-08 19:51:54 +00:00
|
|
|
echo "-y: auto-answer default to all prompts"
|
2015-10-03 12:25:44 +00:00
|
|
|
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)"
|
|
|
|
if [[ $isRpi ]]; then
|
|
|
|
echo "-os: update Raspbian OS, A2CLOUD, A2SERVER, and Apple II Pi"
|
|
|
|
fi
|
|
|
|
[[ $0 == "-bash" ]] && return 1 || exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2015-10-17 03:10:10 +00:00
|
|
|
|
|
|
|
echo "A2SERVER version available: $a2serverVersion"
|
|
|
|
if [[ -f /usr/local/etc/A2SERVER-version ]]; then
|
|
|
|
echo "A2SERVER version installed: $(cat /usr/local/etc/A2SERVER-version)"
|
|
|
|
else
|
|
|
|
echo "A2SERVER version installed: none"
|
|
|
|
fi
|
|
|
|
if [[ $justShowVersion ]]; then
|
|
|
|
# User passed -v to the script, so we stop here
|
|
|
|
[[ $0 == "-bash" ]] && return 1 || exit 1
|
|
|
|
fi
|
|
|
|
|
2015-10-03 12:25:44 +00:00
|
|
|
if [[ $updateRasppleII ]]; then
|
|
|
|
echo "A2SERVER: Updating Raspple II (takes up to an hour)..."
|
2015-10-12 19:30:17 +00:00
|
|
|
wget -qO /tmp/raspbian-update "http://appleii.ivanx.com/a2server/files/raspbian-update.txt"
|
2015-10-03 12:25:44 +00:00
|
|
|
source /tmp/raspbian-update a2cloud a2server $autoAnswerYes $skipRepoUpdate
|
|
|
|
[[ $0 == "-bash" ]] && return 0 || exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if { [[ -f /usr/local/etc/A2SERVER-version ]] && (( $(cat /usr/local/etc/A2SERVER-version) < 110 )); }; then
|
|
|
|
echo
|
|
|
|
echo "WARNING: The current A2SERVER installer scripts haven't been tested for"
|
|
|
|
echo "updating the earlier version of A2SERVER that you have. A fresh install"
|
|
|
|
echo "is suggested. Continuing is not recommended and could make A2SERVER"
|
|
|
|
echo "no longer work properly, or cause data to be lost."
|
|
|
|
fi
|
|
|
|
|
|
|
|
a2server_update=0
|
|
|
|
doSetup=1
|
|
|
|
|
|
|
|
unsupportedOS=1
|
|
|
|
if [[ $isRpi ]]; then #supported Raspbian? (16-Feb-15, 20-Jun-14, 09-Jan-14, etc)
|
|
|
|
fwhash=$(zcat /usr/share/doc/raspberrypi-bootloader/changelog.Debian.gz | grep -m 1 'as of' | awk '{print $NF}')
|
|
|
|
[[ ($fwhash == "8aca5762") || ($fwhash == "462f3e3f476f7b6") || ($fwhash == "c32bc633039cd9") || ($fwhash == "9d34d0475f9") || ($fwhash == "d4f5315cfac4e") || ($fwhash == "6f4a90c8cb8817f") || ($fwhash == "5dd9b4962e") || ($fwhash == "17c8799375") ]] && unsupportedOS=0
|
|
|
|
elif [[ "$(lsb_release -rs 2> /dev/null)" == "12.04" ]]; then #Ubuntu 12.04?
|
2015-10-09 12:29:32 +00:00
|
|
|
unsupportedOS=0
|
2015-10-03 12:25:44 +00:00
|
|
|
elif [[ "$(lsb_release -rs 2> /dev/null)" == "7.3" || "$(lsb_release -rs 2> /dev/null)" == "7.6" || "$(lsb_release -rs 2> /dev/null)" == "7.8" ]]; then # tested Debian?
|
2015-10-09 12:29:32 +00:00
|
|
|
unsupportedOS=0
|
2015-10-03 12:25:44 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if (( unsupportedOS )); then
|
|
|
|
echo
|
|
|
|
echo "WARNING: A2SERVER and its installer scripts have not been tested on this"
|
|
|
|
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."
|
2015-10-06 06:52:43 +00:00
|
|
|
echo "More information is at http://appleii.ivanx.com/a2server."
|
2015-10-03 12:25:44 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
doSetup=1
|
|
|
|
if [[ ! -f /usr/local/etc/a2server-help.txt ]] || (( $a2server_update )); then
|
2015-10-12 23:56:43 +00:00
|
|
|
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."
|
2015-10-09 13:12:42 +00:00
|
|
|
doSetup=$(( 1 - $? ))
|
2015-10-03 12:25:44 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if (( $doSetup )); then
|
|
|
|
|
2015-10-12 23:56:43 +00:00
|
|
|
askYesNo "Continue?" 0 \
|
|
|
|
"a2server-setup modifies files and performs actions as the root user.
|
|
|
|
For details, visit http://appleii.ivanx.com/a2server."
|
2015-10-09 13:12:42 +00:00
|
|
|
doSetup=$(( 1 - $? ))
|
2015-10-06 06:52:43 +00:00
|
|
|
|
2015-10-03 12:25:44 +00:00
|
|
|
if (( $doSetup )); then
|
|
|
|
|
|
|
|
userPw=$(sudo grep "^$USER" /etc/shadow | cut -f 2 -d ':')
|
|
|
|
[[ $userPw == "$(echo 'apple2' | perl -e '$_ = <STDIN>; chomp; print crypt($_, $ARGV[0])' "${userPw%"${userPw#\$*\$*\$}"}")" ]] && isApple2Pw=1 || isApple2Pw=
|
|
|
|
[[ $userPw == "$(echo 'raspberry' | perl -e '$_ = <STDIN>; chomp; print crypt($_, $ARGV[0])' "${userPw%"${userPw#\$*\$*\$}"}")" ]] && isRaspberryPw=1 || isRaspberryPw=
|
|
|
|
|
|
|
|
password="your password"
|
|
|
|
[[ $isApple2Pw ]] && password="'apple2'"
|
|
|
|
[[ $isRaspberryPw ]] && password="'raspberry'"
|
2015-10-06 06:52:43 +00:00
|
|
|
|
2015-10-03 12:25:44 +00:00
|
|
|
|
|
|
|
[[ $isRpi ]] && a2server="your Raspberry Pi" || a2server="A2SERVER"
|
|
|
|
if [[ ! $isApple2Pw && ! -f /usr/local/etc/A2SERVER-version ]]; then
|
2015-10-12 23:56:43 +00:00
|
|
|
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
|
Make askYesNo use a here document for info text
The info text for askYesNo was a problem. First, it involved a long,
complex, paragraph encoded as string on the command line. That's NEVER
a good idea. Secondly, it passed that string unprocessed to printf
(albeit printf(1) but still) as a format string. And third, there's no
way to manage line length when you're doing that.
The alternative is to put the strings in a here document. We then cat
the result between a couple of empty echo commands to create the
original output. This addresses all of the above issues, but creates a
new one: The info text follows the prompt, rather than the other way
around. Not the most elegant.
So … why do this at all, why not just echo the info text outside of the
function, particularly since the function only echoes it once no matter
how many times you give a bogus answer? Well, if at some point we
decide to implement a dialog-type interface (whiptail, zenity, whatever
you prefer), then it becomes easy to do so. Unsure that's desirable at
this time, but options are good.
2015-10-12 09:59:42 +00:00
|
|
|
${a2server} using the same password, you are recommended
|
2015-10-12 23:56:43 +00:00
|
|
|
to change your user password to \"apple2\"."
|
2015-10-08 21:07:46 +00:00
|
|
|
if [ $? -eq 0 ]; then
|
2015-10-03 12:25:44 +00:00
|
|
|
echo "A2SERVER: changing password for user '$USER' to 'apple2'..."
|
|
|
|
echo "$USER:apple2" | sudo chpasswd
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "During this installation, enter ${password} if prompted for passwords."
|
|
|
|
echo
|
|
|
|
|
|
|
|
sudo true
|
2015-10-06 06:52:43 +00:00
|
|
|
|
2015-10-03 12:25:44 +00:00
|
|
|
echo
|
|
|
|
echo "A2SERVER: Downloading scripts..."
|
2015-10-06 06:52:43 +00:00
|
|
|
|
2015-10-04 08:23:53 +00:00
|
|
|
wget -q -O /tmp/1.storage "${scriptURL}scripts/a2server-1-storage.txt"
|
2015-10-03 12:25:44 +00:00
|
|
|
chmod ugo+x /tmp/1.storage
|
2015-10-06 06:52:43 +00:00
|
|
|
|
2015-10-04 08:23:53 +00:00
|
|
|
wget -q -O /tmp/2.tools "${scriptURL}scripts/a2server-2-tools.txt"
|
2015-10-03 12:25:44 +00:00
|
|
|
chmod ugo+x /tmp/2.tools
|
|
|
|
|
2015-10-04 08:23:53 +00:00
|
|
|
wget -q -O /tmp/3.sharing "${scriptURL}scripts/a2server-3-sharing.txt"
|
2015-10-03 12:25:44 +00:00
|
|
|
chmod ugo+x /tmp/3.sharing
|
2015-10-06 06:52:43 +00:00
|
|
|
|
2015-10-04 08:23:53 +00:00
|
|
|
wget -q -O /tmp/5.netboot "${scriptURL}scripts/a2server-5-netboot.txt"
|
2015-10-03 12:25:44 +00:00
|
|
|
chmod ugo+x /tmp/5.netboot
|
2015-10-06 06:52:43 +00:00
|
|
|
|
2015-10-04 08:23:53 +00:00
|
|
|
wget -q -O /tmp/6.samba "${scriptURL}scripts/a2server-6-samba.txt"
|
2015-10-03 12:25:44 +00:00
|
|
|
chmod ugo+x /tmp/6.samba
|
2015-10-06 06:52:43 +00:00
|
|
|
|
2015-10-04 08:23:53 +00:00
|
|
|
wget -q -O /tmp/7.console "${scriptURL}scripts/a2server-7-console.txt"
|
2015-10-03 12:25:44 +00:00
|
|
|
chmod ugo+x /tmp/7.console
|
|
|
|
|
|
|
|
echo "A2SERVER: Scripts have been downloaded. Installing..."
|
2015-10-06 06:52:43 +00:00
|
|
|
|
2015-10-03 12:25:44 +00:00
|
|
|
/tmp/1.storage
|
|
|
|
rm /tmp/1.storage
|
|
|
|
/tmp/2.tools
|
|
|
|
rm /tmp/2.tools
|
|
|
|
/tmp/3.sharing
|
|
|
|
rm /tmp/3.sharing
|
|
|
|
/tmp/5.netboot
|
|
|
|
rm /tmp/5.netboot
|
|
|
|
/tmp/6.samba
|
|
|
|
rm /tmp/6.samba
|
|
|
|
/tmp/7.console
|
|
|
|
rm /tmp/7.console
|
|
|
|
rm /tmp/a2server-packageReposUpdated &> /dev/null
|
2015-10-06 06:52:43 +00:00
|
|
|
|
2015-10-03 12:25:44 +00:00
|
|
|
if [[ ! -f /usr/local/etc/A2SERVER-version ]] \
|
2015-10-09 12:29:32 +00:00
|
|
|
|| (( $(cat /usr/local/etc/A2SERVER-version) < "$a2serverVersion" )); then
|
2015-10-03 12:25:44 +00:00
|
|
|
echo "$a2serverVersion" | sudo tee /usr/local/etc/A2SERVER-version &> /dev/null
|
|
|
|
fi
|
|
|
|
|
|
|
|
source /usr/local/etc/a2server-aliases
|
|
|
|
|
|
|
|
# get Kernel release (e.g. 3.6.11+) and version (e.g. #557)
|
|
|
|
kernelRelease=$(uname -r)
|
|
|
|
kernelMajorRelease=$(cut -d '.' -f 1 <<< $kernelRelease)
|
|
|
|
kernelMinorRelease=$(cut -d '.' -f 2 <<< $kernelRelease | sed 's/\(^[0-9]*\)[^0-9].*$/\1/')
|
|
|
|
|
|
|
|
# all done, see if AppleTalk is available and notify either way
|
|
|
|
if [[ $(ps aux | grep [a]talkd) ]]; then
|
|
|
|
echo "You now have a fully functional file server for Apple II clients."
|
|
|
|
echo "On an Apple IIe, it should be accessible via \"Log In\" on the"
|
|
|
|
echo "Workstation Card software. For IIgs users, it should be accessible"
|
|
|
|
echo "via the AppleShare control panel."
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo "A2SERVER setup is complete! Go connect from your Apple II!"
|
|
|
|
echo
|
|
|
|
elif [[ -f /tmp/rpiUpdate ]]; then
|
2015-10-12 23:56:43 +00:00
|
|
|
askYesNo "Restart now?" 0 \
|
|
|
|
"A2SERVER is now configured, but Apple II clients will not be able
|
|
|
|
to connect until you restart your Raspberry Pi."
|
2015-10-08 21:07:46 +00:00
|
|
|
if [ $? -eq 0 ]; then
|
2015-10-03 12:25:44 +00:00
|
|
|
sudo shutdown -r now
|
|
|
|
echo
|
|
|
|
echo "A2SERVER: Preparing to restart..."
|
|
|
|
while :; do sleep 60; done
|
|
|
|
fi
|
|
|
|
rm /tmp/rpiUpdate
|
|
|
|
echo
|
|
|
|
elif [[ $kernelMajorRelease -eq 3 && $kernelMinorRelease -ge 12 ]]; then
|
|
|
|
echo "A2SERVER is now configured, but Apple II clients cannot connect"
|
|
|
|
echo "because of a kernel-crashing bug in Linux kernel 3.12 through 3.15."
|
|
|
|
echo "You have kernel version $kernelMajorRelease.$kernelMinorRelease."
|
|
|
|
echo "A2SERVER has disabled AppleTalk networking to prevent crashes."
|
|
|
|
echo "Please use kernel 3.11 or earlier, or kernel 3.16 or later."
|
|
|
|
echo
|
|
|
|
else
|
|
|
|
echo "A2SERVER is now configured, but Apple II clients cannot connect because"
|
|
|
|
echo "AppleTalk networking is unavailable. Please make sure that"
|
|
|
|
echo "your Linux distribution has a loadable AppleTalk kernel module or"
|
|
|
|
echo "has AppleTalk built into the kernel, and restart your server."
|
|
|
|
echo "Or, if you previously disabled AppleTalk in A2SERVER, re-enable it"
|
|
|
|
echo "by typing 'appletalk-on'."
|
|
|
|
echo
|
|
|
|
fi
|
2015-10-06 06:52:43 +00:00
|
|
|
|
2015-10-03 12:25:44 +00:00
|
|
|
if [[ -f /tmp/singleUser ]]; then
|
2015-10-12 23:56:43 +00:00
|
|
|
askYesNo "Restart now?" 0 \
|
|
|
|
"Your Raspberry Pi was started in single-user mode in order tofix a problem. You should restart to operate normally."
|
2015-10-08 21:07:46 +00:00
|
|
|
if [ $? -eq 0 ]; then
|
2015-10-03 12:25:44 +00:00
|
|
|
sudo shutdown -r now
|
|
|
|
echo
|
|
|
|
echo "A2SERVER: Preparing to restart..."
|
|
|
|
while :; do sleep 60; done
|
|
|
|
fi
|
|
|
|
echo
|
|
|
|
fi
|
2015-10-06 06:52:43 +00:00
|
|
|
|
2015-10-03 12:25:44 +00:00
|
|
|
echo
|
2015-10-09 12:29:32 +00:00
|
|
|
echo "Type 'system-shutdown' to turn off A2SERVER."
|
|
|
|
echo "Type 'a2server-setup' to configure network boot."
|
|
|
|
echo "Type 'a2server-help' for a list of other commands."
|
2015-10-03 12:25:44 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
unset a2server_update 2> /dev/null
|
|
|
|
unset doSetup 2> /dev/null
|
2015-10-08 19:51:54 +00:00
|
|
|
rm /tmp/a2server-autoAnswerDefault 2> /dev/null
|
2015-10-03 12:25:44 +00:00
|
|
|
rm /tmp/a2server-packageReposUpdated 2> /dev/null
|
|
|
|
rm /tmp/a2server-setupNetBoot 2> /dev/null
|
|
|
|
rm /tmp/a2server-setupWindowsSharing 2> /dev/null
|
|
|
|
rm setup &> /dev/null
|