Didn't touch the Samba workgroup question for now since it's the only
question that asks anything else. Maybe when this stuff gets refactored
to remove duplication.
Overzealous replacement of hardcoded ivanx.com with script variable.
The A2CLOUD disk image should be downloaded right off Ivan's server
because we don't have it in the git repository.
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.
This file really belongs in the A2SERVER root where people looking at
this tree can most easily find it, but for now it's more important to
follow the layout on Ivan's server. Putting it in the root was a
mistake on my part in my initial upload because "of course". Corrected!
Reflowed the scripts (mostly) according to vim's autoindent engine.
Also added vim modelines so that people who are familiar with them can
configure their environment for A2SERVER's conventions. Also removed
trailing whitespace from lines and files while I was at it to make git
happier about various things.
An unusual quirk of git is that it tends not to like trailing whitespace
at the end of lines, and trailing blank lines at the end of a file. It
messes with the word diffs a bit I think. Anyway, it's easily removed,
so I've removed it.
This should theoretically make the a2server-setup and a2server-update
aliases use/honor A2SERVER_SCRIPT_URL if it's set. How this is done is
presently kind of ugly since it invokes a subshell to ensure the URL
ends in a slash, so if someone has a better idea of how to do that in a
bash alias, please file a ticket!
FWIW the reason why I keep adding shebang lines to these scripts that
get sourced (and therefore don't need them) is that it alerts a few text
editors that offer syntax highlighting based on magic numbers in files
that they are in fact bash scripts and contain bashisms that shouldn't
be flagged as errors in strict bourne shells.
Turns out a2server-help isn't actually a script, it's actually a text
file which is more'd by an alias of the same name. We could cleverly
replace that alias with a very clever shebang line, but ... principle of
least resistance.
This is perhaps less than ideal, but it should make the scripts work in
any web directory you put the repository into. As such, this should be
considered part of the "initial state" trying to match Ivan's current
non-SCM setup. We can adjust this later if he does something different
on his end.
Ivan's precompiled binaries of nulib2, The Unarchiver, and netatalk for
Debian and Raspbian aren't going to be part of this repository, so I've
reverted to hardcoding Ivan's server as the source of those things.
We could perhaps download and compile nulib2 and The Unarchiver, and
we'd have to if the script doesn't recognize Debian/Raspbian. Ideally
for those systems we'd download .deb packages with full and proper
dependency tracking, but we'd still need source for use on non-Debian
systems, should we ever develop support for those. (OS X is a good
candidate for such a system?)
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 reflects Ivan Drucker's current A2SERVER scripts as of 2015-Oct-01,
version 1.24. These are unmodified and cannot be directly used yet. A
later patch will begin correcting that, but a baseline is important.