mirror of
				https://github.com/RasppleII/a2server.git
				synced 2025-10-30 23:16:08 +00:00 
			
		
		
		
	Compare commits
	
		
			54 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | a3a7a9479d | ||
|  | 34836dcbb4 | ||
|  | 7b7917d417 | ||
|  | 938db3c46b | ||
|  | 4d1b5db5e3 | ||
|  | 7d1a06a916 | ||
|  | f9b120002a | ||
|  | 49d50e49ac | ||
|  | dfa1e26c80 | ||
|  | d86e3bfa88 | ||
|  | cd20570999 | ||
|  | cd8271cd56 | ||
|  | 750b9998df | ||
|  | 9ba5258fe0 | ||
|  | 50875f5c3f | ||
|  | ca4e3b76e6 | ||
|  | 3a82176d0a | ||
|  | 061c3c1897 | ||
|  | dea2ea2ce2 | ||
|  | bb5f42462e | ||
|  | 59d293ec84 | ||
|  | 9dfbe0e9f3 | ||
|  | ca12a4a9e9 | ||
|  | 94b6dcaa26 | ||
|  | da204bd05b | ||
|  | fbc1ce5ba2 | ||
|  | b7528026de | ||
|  | 60f88e4e8a | ||
|  | 13343a5c2a | ||
|  | 95fb701098 | ||
|  | 3a0e123c0a | ||
|  | 5c47545772 | ||
|  | c5460eb292 | ||
|  | 653218535f | ||
|  | a0ded5a7cf | ||
|  | 3cc2beabcf | ||
|  | 4ca810bd26 | ||
|  | f8d7a916e2 | ||
|  | 80c4818d47 | ||
|  | b846df61da | ||
|  | ec0bf3b9d5 | ||
|  | 631ad8a2e2 | ||
|  | 4ad9e10c77 | ||
|  | 9760380115 | ||
|  | 5660347bc8 | ||
|  | 6f835905af | ||
|  | 9bd8b0d3f0 | ||
|  | 9b87db8eb4 | ||
|  | 71274cb18f | ||
|  | 502e638964 | ||
|  | 85cbf4d741 | ||
|  | c5c14759d1 | ||
|  | 6e9ddb5e47 | ||
|  | 180dcc5634 | 
							
								
								
									
										86
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										86
									
								
								README.md
									
									
									
									
									
								
							| @@ -13,22 +13,84 @@ relatively modern piece of it.  As such they should be preserved as they are. | |||||||
|  |  | ||||||
| ## Developer note | ## Developer note | ||||||
|  |  | ||||||
| To use the scripts on a server other than Ivan's, you'll want to export | To use the scripts on your own server, including your local machine: | ||||||
| the shell variable A2SERVER_SCRIPT_URL to the base URL of this repository |  | ||||||
| on your server.  The base-URL should be slash-terminated.  You can then run |  | ||||||
| the following snippet: |  | ||||||
|  |  | ||||||
| ~~~ bash | ~~~ bash | ||||||
| wget -O a2server-setup ${A2SERVER_SCRIPT_URL}setup/index.txt; source a2server-setup | export A2SERVER_SCRIPT_URL=http://yoururl.com/ | ||||||
| ~~~ | ~~~ | ||||||
|  |  | ||||||
| A simple method for installing from a local subdirectory is to `cd` to it and | To prevent needing to recompile various packages from source code during | ||||||
| then type `python -m SimpleHTTPServer`. Then | installation, a number of precompiled binary files are downloaded for Raspbian, | ||||||
| `export A2SERVER_SCRIPT_URL="http://localhost:8000/"` | Debian-x86, and Debian-amd64. If you wish to host these on your own server: | ||||||
| or use the IP address of the host machine on your LAN instead of localhost. |  | ||||||
|  | ~~~ bash | ||||||
|  | export A2SERVER_BINARY_URL=http://yoururl.com/files/ | ||||||
|  | ~~~ | ||||||
|  |  | ||||||
|  | You do not need to use a subdirectory called "files", or the same server, but | ||||||
|  | that's the normal arrangement. The precompiled packages are available here: | ||||||
|  | `http://ivanx.com/a2server/files/dist/a2serverbinaries.tar.gz` | ||||||
|  |  | ||||||
|  | Several Apple II third-party binaries are downloaded during installation, as | ||||||
|  | well as third-party source code if precompiled binaries are unavailable or | ||||||
|  | you don't wish to use them. If you want these external dependencies locally | ||||||
|  | during development, they need to go into a folder called "external" in | ||||||
|  | the binaries URL, and that needs to contain folders called "appleii" and | ||||||
|  | "source". To download all of these external packages, download and run the | ||||||
|  | shell script at | ||||||
|  | `http://ivanx.com/a2server/files/dist/getexternal.sh`. | ||||||
|  |  | ||||||
|  | Once you have those: | ||||||
|  |  | ||||||
|  | ~~~ bash | ||||||
|  | export A2SERVER_NO_EXTERNAL=1 | ||||||
|  | ~~~ | ||||||
|  |  | ||||||
|  | You may want to put the above exports into `~/.bashrc` or `~/.bash_profile`. | ||||||
|  |  | ||||||
|  | If you want to host scripts locally installed on your own machine or another | ||||||
|  | computer on your LAN, type the following, and export "http://localhost:8000/" | ||||||
|  | or "http://lan.ip.address:8000/" for the above URL's. | ||||||
|  |  | ||||||
|  | ~~~ | ||||||
|  | python -m SimpleHTTPServer | ||||||
|  | ~~~ | ||||||
|  |  | ||||||
|  | Once you're set, you can then run the following snippet to install A2SERVER: | ||||||
|  |  | ||||||
|  | ~~~ | ||||||
|  | wget -O setup ${A2SERVER_SCRIPT_URL}setup/index.txt; source setup | ||||||
|  | ~~~ | ||||||
|  |  | ||||||
|  |  | ||||||
|  | Offline install: | ||||||
|  |  | ||||||
|  | Using locally hosted binaries and external dependencies, it's possible to | ||||||
|  | install completely offline if dependent packages have been installed. | ||||||
|  |  | ||||||
|  | If precompiled binaries are available, on Wheezy: | ||||||
|  |  | ||||||
|  | ~~~ | ||||||
|  | sudo apt-get -y install unzip libgnustep-base1.22 libdb5.1 libgcrypt11 libssl1.0.0 attr fuse libglib2.0-0 libattr1 libfuse2 | ||||||
|  | ~~~ | ||||||
|  |  | ||||||
|  | If precompiled binaries are available, on Jessie: | ||||||
|  |  | ||||||
|  | ~~~ | ||||||
|  | sudo apt-get -y install unzip unar libdb5.3 libgcrypt20 libssl1.0.0 attr fuse libglib2.0-0 libattr1 libfuse2 | ||||||
|  | ~~~ | ||||||
|  |  | ||||||
|  | If precompiled binaries are not available, on Wheezy: | ||||||
|  |  | ||||||
|  | ~~~ | ||||||
|  | sudo apt-get -y install unzip build-essential zlib1g-dev libgnustep-base-dev libz-dev libbz2-dev libssl-dev libicu-dev libdb5.1-dev libgcrypt11-dev libglib2.0-dev libattr1-dev libfuse-dev | ||||||
|  | ~~~ | ||||||
|  |  | ||||||
|  | If precompiled binaries are not available, on Jessie: | ||||||
|  |  | ||||||
|  | ~~~ | ||||||
|  | sudo apt-get -y install unzip unar build-essential zlib1g-dev unzip libssl-dev libdb5.3-dev libgcrypt11-dev libglib2.0-dev libattr1-dev libfuse-dev | ||||||
|  | ~~~ | ||||||
|  |  | ||||||
| You should probably export A2SERVER_SCRIPT_URL in your .bashrc or whatever |  | ||||||
| file configures your development environment.  Also be advised that as of |  | ||||||
| version 1.24 of A2SERVER, you must use the snippet above. |  | ||||||
|  |  | ||||||
| [Ivan's site]: http://appleii.ivanx.com/a2server/ | [Ivan's site]: http://appleii.ivanx.com/a2server/ | ||||||
|   | |||||||
							
								
								
									
										1749
									
								
								files/A2FILES-list.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1749
									
								
								files/A2FILES-list.txt
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										66
									
								
								files/dist/getexternal.sh
									
									
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										66
									
								
								files/dist/getexternal.sh
									
									
									
									
										vendored
									
									
										Executable file
									
								
							| @@ -0,0 +1,66 @@ | |||||||
|  | #! /bin/bash | ||||||
|  | # vim: set tabstop=4 shiftwidth=4 expandtab filetype=sh: | ||||||
|  |  | ||||||
|  | if ! hash wget; then | ||||||
|  |     echo "wget is not installed. On a Mac, install it with MacPorts or Homebrew." | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | echo "Downloading items..." | ||||||
|  |  | ||||||
|  | mkdir -p files/external/source | ||||||
|  | wget -O files/external/source/ciopfs-0.4.tar.gz http://www.brain-dump.org/projects/ciopfs/ciopfs-0.4.tar.gz | ||||||
|  | wget -O files/external/source/macipgw.zip https://github.com/zero2sixd/macipgw/archive/2a5f6a7521a627e46b18468d44f4306fb0a7b7ab.zip | ||||||
|  | wget -O files/external/source/netatalk-2.2.4.tar.gz http://downloads.sourceforge.net/project/netatalk/netatalk/2.2.4/netatalk-2.2.4.tar.gz | ||||||
|  | wget -O files/external/source/nulib2-3.1.0a2.zip https://github.com/fadden/nulib2/archive/20fe7efb4d37fedf807416c16d74d51d893ea48a.zip | ||||||
|  | wget -O files/external/source/unar-1.8.1.zip https://github.com/incbee/Unarchiver/archive/unar-1.8.1.zip | ||||||
|  |  | ||||||
|  | mkdir -p files/external/appleii | ||||||
|  | wget --max-redirect 0 -O files/external/appleii/Apple_II_System_Disk_3.2.sea.bin http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/English-North_American/Apple_II/Apple_II_Supplemental/Apple_II_System_Disk_3.2.sea.bin | ||||||
|  | wget -O files/external/appleii/Asimov.shk http://www.ninjaforce.com/downloads/Asimov.shk | ||||||
|  | wget -O files/external/appleii/MOUNTIT.SHK http://www.brutaldeluxe.fr/products/apple2gs/MOUNTIT.SHK | ||||||
|  | wget -O files/external/appleii/Marinetti3.0b8.po http://www.a2retrosystems.com/downloads/Marinetti3.0b8.po | ||||||
|  | wget -O files/external/appleii/PPPX.1.3d4.SHK http://www.apple2.org/marinetti/PPPX.1.3d4.SHK | ||||||
|  | wget -O files/external/appleii/dsk2file.shk http://www.dwheeler.com/6502/oneelkruns/dsk2file.zip | ||||||
|  | wget -O files/external/appleii/gshk11.sea http://www.nulib.com/library/gshk11.sea | ||||||
|  | wget -O files/external/appleii/shrinkit.sdk http://www.nulib.com/library/shrinkit.sdk | ||||||
|  | wget -O files/external/appleii/spectrum_gold_2mg.zip http://www.speccie.co.uk/speccie/software/spectrum_gold_2mg.zip | ||||||
|  | wget -O files/external/appleii/uthernet2ll.bxy http://www.speccie.co.uk/speccie/software/uthernet2ll.bxy | ||||||
|  | wget -O files/external/appleii/uthernetll.bxy http://www.speccie.co.uk/speccie/software/uthernetll.bxy | ||||||
|  |  | ||||||
|  | unset safeUrl samUrl snapUrl safeVer samVer snapVer | ||||||
|  | html=$(wget -qO- http://speccie.co.uk/speccie/Site/Download_Centre_files/widget1_markup.html) | ||||||
|  | safeUrl=$(echo "$html" | grep -i 'safe2.*bxy' | tr '<>' '\n' | grep href | cut -d '=' -f 2 | tr -d '"') | ||||||
|  | samUrl=$(echo "$html" | grep -i 'sam2.*bxy' | tr '<>' '\n' | grep href | cut -d '=' -f 2 | tr -d '"') | ||||||
|  | snapUrl=$(echo "$html" | grep -i 'snap.*bxy' | tr '<>' '\n' | grep href | cut -d '=' -f 2 | tr -d '"') | ||||||
|  | wget -O files/external/appleii/safe2.bxy "$safeUrl" | ||||||
|  | wget -O files/external/appleii/sam2.bxy "$samUrl" | ||||||
|  | wget -O files/external/appleii/snap.bxy "$snapUrl" | ||||||
|  |  | ||||||
|  | for gsosInstall in {1..3}; do | ||||||
|  |     activeDisk=0 | ||||||
|  |     mkdir -p files/external/appleii/gsos60${gsosInstall} | ||||||
|  |      | ||||||
|  |     diskNames=( Install System.Disk SystemTools1 SystemTools2 Fonts synthLAB ) | ||||||
|  |     if (( $gsosInstall == 1 )); then | ||||||
|  |         gsosURL="http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/English-North_American/Apple_II/Apple_IIGS_System_6.0.1/" | ||||||
|  |         wget --max-redirect 0 -O files/external/appleii/gsos601/Disk_7_of_7-Apple_II_Setup.sea.bin http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/English-North_American/Apple_II/Apple_IIGS_System_6.0.1/Disk_7_of_7-Apple_II_Setup.sea.bin | ||||||
|  |     elif (( $gsosInstall == 2 )); then | ||||||
|  |         gsosURL="http://mirrors.apple2.org.za/Apple%20II%20Documentation%20Project/Software/Operating%20Systems/Apple%20IIGS%20System/Disk%20Images/" | ||||||
|  |         diskNames=( Install System.Disk SystemTools1 SystemTools2 SystemTools3 Fonts1 Fonts2 synthLAB ) | ||||||
|  |         diskWebNames=( Install System%20disk System%20tools%201 System%20tools%202 System%20tools%203 Fonts%201 Fonts%202 Synthlab ) | ||||||
|  |     elif (( $gsosInstall == 3 )); then | ||||||
|  |         gsosURL="ftp://ftp.apple.asimov.net/pub/apple_II/images/gs/os/gsos/Apple_IIGS_System_6.0.3/" | ||||||
|  |     fi | ||||||
|  |  | ||||||
|  |     for diskname in ${diskNames[@]}; do | ||||||
|  |         outfile="files/external/appleii/gsos60${gsosInstall}/$diskname.po" | ||||||
|  |         (( activeDisk++ )) | ||||||
|  |         if (( $gsosInstall == 1 )); then | ||||||
|  |             wget --max-redirect 0 -O files/external/appleii/gsos601/"Disk_${activeDisk}_of_7-${diskname}.sea.bin" "${gsosURL}Disk_${activeDisk}_of_7-${diskname}.sea.bin" | ||||||
|  |         elif (( $gsosInstall == 2 )); then | ||||||
|  |             wget -O $outfile "$gsosURL/IIGS%20System%206.0.2%20-%20Disk%20${activeDisk}%20${diskWebNames[$activeDisk-1]}.po" | ||||||
|  |         elif (( $gsosInstall == 3 )); then | ||||||
|  |             wget -O $outfile "$gsosURL/$diskname.po" | ||||||
|  |         fi | ||||||
|  |     done | ||||||
|  | done | ||||||
							
								
								
									
										152
									
								
								files/netatalk-init.d-clean.txt
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										152
									
								
								files/netatalk-init.d-clean.txt
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,152 @@ | |||||||
|  | #!/bin/sh | ||||||
|  | ### BEGIN INIT INFO | ||||||
|  | # Provides:          netatalk | ||||||
|  | # Required-Start:    $remote_fs $syslog | ||||||
|  | # Should-Start:      avahi-daemon | ||||||
|  | # Required-Stop:     $remote_fs $syslog | ||||||
|  | # Default-Start:     2 3 4 5 | ||||||
|  | # Default-Stop:      1 | ||||||
|  | ### END INIT INFO | ||||||
|  | # | ||||||
|  | # netatalk      Netatalk 2.2.4 initscript | ||||||
|  | # Author:       Thomas Kaiser <Thomas.Kaiser@phg-online.de> | ||||||
|  |  | ||||||
|  | set -e | ||||||
|  |  | ||||||
|  | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||||||
|  | DESC="Netatalk" | ||||||
|  | NAME=netatalk | ||||||
|  | SCRIPTNAME=/etc/init.d/$NAME | ||||||
|  |  | ||||||
|  | # Guard to prevent execution if netatalk was removed. | ||||||
|  | test -x /usr/local/sbin/afpd || exit 0 | ||||||
|  |  | ||||||
|  | # Set defaults. Please change these options in /etc/default/netatalk | ||||||
|  | ATALK_NAME=`/bin/hostname --short` | ||||||
|  | ATALK_UNIX_CHARSET='LOCALE' | ||||||
|  | ATALK_MAC_CHARSET='MAC_ROMAN' | ||||||
|  |  | ||||||
|  | CNID_METAD_RUN=yes | ||||||
|  | AFPD_RUN=yes | ||||||
|  | AFPD_MAX_CLIENTS=50 | ||||||
|  | AFPD_UAMLIST="-U uams_dhx2.so" | ||||||
|  | AFPD_GUEST=nobody | ||||||
|  | CNID_CONFIG="-l log_note" | ||||||
|  |  | ||||||
|  | ATALKD_RUN=no | ||||||
|  | PAPD_RUN=no | ||||||
|  | TIMELORD_RUN=no | ||||||
|  | #A2BOOT_RUN=no | ||||||
|  | ATALK_ZONE= | ||||||
|  | ATALK_BGROUND=no | ||||||
|  |  | ||||||
|  | # old /etc/default/netatalk expected hostname in $HOSTNAME by default | ||||||
|  | HOSTNAME=`/bin/hostname` | ||||||
|  |  | ||||||
|  | # Read in netatalk configuration. | ||||||
|  | if [ -f /etc/default/netatalk ]; then | ||||||
|  |     . /etc/default/netatalk | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | # Start Netatalk servers. | ||||||
|  | atalk_startup() { | ||||||
|  | 	if [ x"$ATALKD_RUN" = x"yes" ]; then | ||||||
|  |  | ||||||
|  | 	# Try to load the AppleTalk kernel module if it was intended. | ||||||
|  |     if grep -q '^appletalk$' /etc/modules; then | ||||||
|  | 		/sbin/modprobe appletalk || echo "[could not load appletalk module]" | ||||||
|  |     fi | ||||||
|  |  | ||||||
|  | 	# Start atalkd server. | ||||||
|  | 	/usr/local/sbin/atalkd | ||||||
|  |  | ||||||
|  | 	# register workstation | ||||||
|  | 	/usr/local/bin/nbprgstr -p 4 "$ATALK_NAME:Workstation$ATALK_ZONE" | ||||||
|  | 	/usr/local/bin/nbprgstr -p 4 "$ATALK_NAME:netatalk$ATALK_ZONE" | ||||||
|  |  | ||||||
|  | 	echo -n " atalkd" | ||||||
|  | 	fi | ||||||
|  | 	 | ||||||
|  | 	# prepare startup of file services | ||||||
|  | 	if [ "x$CNID_METAD_RUN" = "xyes" -a -x /usr/local/sbin/cnid_metad ] ; then | ||||||
|  | 		echo -n " cnid_metad" | ||||||
|  |         /usr/local/sbin/cnid_metad $CNID_CONFIG | ||||||
|  |     fi | ||||||
|  | 	 | ||||||
|  | 	if [ x"$AFPD_RUN" = x"yes" ]; then | ||||||
|  | 	/usr/local/sbin/afpd $AFPD_UAMLIST -g $AFPD_GUEST -c $AFPD_MAX_CLIENTS \ | ||||||
|  | 		-n "$ATALK_NAME$ATALK_ZONE" | ||||||
|  | 	echo -n " afpd" | ||||||
|  | 	fi | ||||||
|  |  | ||||||
|  |     if [ "x$ATALKD_RUN" = "xyes" ]; then | ||||||
|  |         if [ "x$PAPD_RUN" = "xyes" ]; then | ||||||
|  |             /usr/local/sbin/papd | ||||||
|  |             echo -n " papd" | ||||||
|  |         fi | ||||||
|  |  | ||||||
|  |         if [ x"$TIMELORD_RUN" = x"yes" ]; then | ||||||
|  |             /usr/local/sbin/timelord | ||||||
|  |             echo -n " timelord" | ||||||
|  |         fi | ||||||
|  |     fi | ||||||
|  | } | ||||||
|  |  | ||||||
|  | case "$1" in | ||||||
|  | 	start) | ||||||
|  | 		if [ "x$ATALK_BGROUND" = "xyes" -a "x$ATALKD_RUN" = "xyes" ]; then | ||||||
|  | 			echo "Starting Netatalk services in the background." | ||||||
|  | 			atalk_startup >/dev/null & | ||||||
|  | 		else | ||||||
|  | 			echo -n "Starting Netatalk services (this will take a while): " | ||||||
|  | 			atalk_startup | ||||||
|  | 			echo "." | ||||||
|  | 		fi | ||||||
|  | 	;; | ||||||
|  |  | ||||||
|  | 	stop) | ||||||
|  | 		echo -n "Stopping Netatalk Daemons:" | ||||||
|  | 		echo -n " afpd" | ||||||
|  | 		start-stop-daemon --stop --quiet --oknodo --exec /usr/local/sbin/afpd | ||||||
|  |  | ||||||
|  | 		echo -n " cnid_metad" | ||||||
|  | 		start-stop-daemon --stop --quiet --oknodo --exec /usr/local/sbin/cnid_metad | ||||||
|  | 	 | ||||||
|  | 		if test -x /usr/local/sbin/papd; then | ||||||
|  |                     echo -n " papd" | ||||||
|  | 		    start-stop-daemon --stop --quiet --oknodo --exec /usr/local/sbin/papd | ||||||
|  | 	        fi | ||||||
|  | 	 | ||||||
|  | 		if test -x /usr/local/sbin/timelord; then | ||||||
|  |                     echo -n " timelord" | ||||||
|  | 		    start-stop-daemon --stop --quiet --oknodo --exec /usr/local/sbin/timelord | ||||||
|  | 	        fi | ||||||
|  |  | ||||||
|  | 		if test -x /usr/local/sbin/atalkd; then | ||||||
|  |                     echo -n " atalkd" | ||||||
|  | 		    start-stop-daemon --stop --quiet --oknodo --exec /usr/local/sbin/atalkd | ||||||
|  | 	        fi | ||||||
|  | 	 | ||||||
|  | 		echo "." | ||||||
|  | 	;; | ||||||
|  | 	 | ||||||
|  | 	restart) | ||||||
|  | 		$0 force-reload | ||||||
|  | 	;; | ||||||
|  |  | ||||||
|  | 	force-reload) | ||||||
|  | 		echo -n "Restarting Netatalk Daemons (this will take a while)" | ||||||
|  | 		$0 stop | ||||||
|  | 		echo -n "." | ||||||
|  | 		sleep 2 | ||||||
|  | 		echo -n "." | ||||||
|  | 		if $0 start; then | ||||||
|  | 			echo "done." | ||||||
|  | 		fi | ||||||
|  | 	;; | ||||||
|  |    | ||||||
|  | 	*) | ||||||
|  | 		echo "Usage: $0 {start|stop|restart|force-reload}" >&2 | ||||||
|  | 		exit 1 | ||||||
|  | 	;; | ||||||
|  | esac | ||||||
| @@ -7,7 +7,7 @@ | |||||||
| # 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" ;; | ||||||
| 	*) scriptURL="${A2SERVER_SCRIPT_URL:-http://ivanx.com/a2server}/" ;; | 	*) scriptURL="${A2SERVER_SCRIPT_URL:-https://raw.githubusercontent.com/RasppleII/a2server/current}/" ;; | ||||||
| esac | esac | ||||||
| case "$A2SERVER_BINARY_URL" in | case "$A2SERVER_BINARY_URL" in | ||||||
| 	*/) binaryURL="$A2SERVER_BINARY_URL" ;; | 	*/) binaryURL="$A2SERVER_BINARY_URL" ;; | ||||||
| @@ -22,7 +22,7 @@ arch= | |||||||
| if [[ -f /usr/bin/raspi-config ]]; then | if [[ -f /usr/bin/raspi-config ]]; then | ||||||
|     isRpi=1 |     isRpi=1 | ||||||
|     arch='rpi' |     arch='rpi' | ||||||
| elif lsb_release -a 2> /dev/null | grep -q 'Distributor ID:.Debian' && [[ $(cut -c 1 <<< $debianVersion) -ge "7" ]]; then | elif lsb_release -a 2> /dev/null | grep -q 'Distributor ID:.Debian' && [[ $(cut -d . -f 1 <<< $debianVersion) -ge "7" ]]; then | ||||||
|     uname_m="$(uname -m)" |     uname_m="$(uname -m)" | ||||||
|     if [[ $uname_m == "i686" ]]; then |     if [[ $uname_m == "i686" ]]; then | ||||||
|         arch='debian_x86' |         arch='debian_x86' | ||||||
| @@ -33,10 +33,10 @@ fi | |||||||
|  |  | ||||||
| debianName= | debianName= | ||||||
| if [[ $debianVersion ]]; then | if [[ $debianVersion ]]; then | ||||||
|     debianMajor=$(cut -c 1-2 <<< $debianVersion) |     debianMajor=$(cut -d . -f 1 <<< $debianVersion) | ||||||
|     if [[ $debianMajor == "8." ]]; then |     if [[ $debianMajor == "8" ]]; then | ||||||
|         debianName="jessie" |         debianName="jessie" | ||||||
|     elif [[ $debianMajor == "7." ]]; then |     elif [[ $debianMajor == "7" ]]; then | ||||||
|         debianName="wheezy" |         debianName="wheezy" | ||||||
|     else |     else | ||||||
|         debianName="unknown" |         debianName="unknown" | ||||||
| @@ -60,7 +60,7 @@ if ! hash nulib2 &> /dev/null; then | |||||||
|  |  | ||||||
|     cd /tmp |     cd /tmp | ||||||
|     if [[ $arch && ! -f /tmp/a2server-compileAlways ]]; then |     if [[ $arch && ! -f /tmp/a2server-compileAlways ]]; then | ||||||
|         { wget -qO- "${binaryURL}precompiled/nulib2-3.1.0a1-${arch}.tgz" | sudo tar Pzx; } &> /dev/null |         { wget -qO- "${binaryURL}precompiled/nulib2-3.1.0a2-${arch}.tgz" | sudo tar Pzx; } &> /dev/null | ||||||
|     fi |     fi | ||||||
|          |          | ||||||
|     if ! hash nulib2 &> /dev/null; then |     if ! hash nulib2 &> /dev/null; then | ||||||
| @@ -80,14 +80,14 @@ if ! hash nulib2 &> /dev/null; then | |||||||
|         mkdir /tmp/nulib2 |         mkdir /tmp/nulib2 | ||||||
|         cd /tmp/nulib2 |         cd /tmp/nulib2 | ||||||
|         if [[ $useExternalURL ]]; then |         if [[ $useExternalURL ]]; then | ||||||
|             wget -q -O nulib2-3.1.0a1.zip "https://github.com/fadden/nulib2/archive/51af83986cd5798daa7e0d82a161c9d3963c72bc.zip" |             wget -q -O nulib2-3.1.0a2.zip "https://github.com/fadden/nulib2/archive/20fe7efb4d37fedf807416c16d74d51d893ea48a.zip" | ||||||
|             unzip nulib2-3.1.0a1.zip 2> /dev/null |             unzip nulib2-3.1.0a2.zip 2> /dev/null | ||||||
|             rm nulib2-3.1.0a1.zip &> /dev/null |             rm nulib2-3.1.0a2.zip &> /dev/null | ||||||
|         fi |         fi | ||||||
|         if [ ! -d nulib2* ]; then |         if [ ! -d nulib2* ]; then | ||||||
|             wget -q -O nulib2-3.1.0a1.zip "${binaryURL}external/source/nulib2-3.1.0a1.zip" |             wget -q -O nulib2-3.1.0a2.zip "${binaryURL}external/source/nulib2-3.1.0a2.zip" | ||||||
|             unzip nulib2-3.1.0a1.zip 2> /dev/null |             unzip nulib2-3.1.0a2.zip 2> /dev/null | ||||||
|             rm nulib2-3.1.0a1.zip &> /dev/null |             rm nulib2-3.1.0a2.zip &> /dev/null | ||||||
|         fi |         fi | ||||||
|         cd nulib2* |         cd nulib2* | ||||||
|         cd nufxlib |         cd nufxlib | ||||||
| @@ -120,7 +120,7 @@ if ! hash unar &> /dev/null; then | |||||||
|     fi |     fi | ||||||
|  |  | ||||||
|     # jessie and later: Just use the unar package |     # jessie and later: Just use the unar package | ||||||
|     if [[ $debianName == "jessie" ]]; then |     if [[ $debianMajor -ge 8 ]]; then | ||||||
|         sudo apt-get -y install unar |         sudo apt-get -y install unar | ||||||
|         sudo apt-get clean |         sudo apt-get clean | ||||||
|     fi |     fi | ||||||
|   | |||||||
| @@ -17,7 +17,7 @@ | |||||||
| # 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" ;; | ||||||
| 	*) scriptURL="${A2SERVER_SCRIPT_URL:-http://appleii.ivanx.com/a2server}/" ;; | 	*) scriptURL="${A2SERVER_SCRIPT_URL:-https://raw.githubusercontent.com/RasppleII/a2server/current}/" ;; | ||||||
| esac | esac | ||||||
| case "$A2SERVER_BINARY_URL" in | case "$A2SERVER_BINARY_URL" in | ||||||
| 	*/) binaryURL="$A2SERVER_BINARY_URL" ;; | 	*/) binaryURL="$A2SERVER_BINARY_URL" ;; | ||||||
| @@ -32,7 +32,7 @@ arch= | |||||||
| if [[ -f /usr/bin/raspi-config ]]; then | if [[ -f /usr/bin/raspi-config ]]; then | ||||||
|     isRpi=1 |     isRpi=1 | ||||||
|     arch='rpi' |     arch='rpi' | ||||||
| elif lsb_release -a 2> /dev/null | grep -q 'Distributor ID:.Debian' && [[ $(cut -c 1 <<< $debianVersion) -ge "7" ]]; then | elif lsb_release -a 2> /dev/null | grep -q 'Distributor ID:.Debian' && [[ $(cut -d . -f 1 <<< $debianVersion) -ge "7" ]]; then | ||||||
|     uname_m="$(uname -m)" |     uname_m="$(uname -m)" | ||||||
|     if [[ $uname_m == "i686" ]]; then |     if [[ $uname_m == "i686" ]]; then | ||||||
|         arch='debian_x86' |         arch='debian_x86' | ||||||
| @@ -43,10 +43,10 @@ fi | |||||||
|  |  | ||||||
| debianName= | debianName= | ||||||
| if [[ $debianVersion ]]; then | if [[ $debianVersion ]]; then | ||||||
|     debianMajor=$(cut -c 1-2 <<< $debianVersion) |     debianMajor=$(cut -d . -f 1 <<< $debianVersion) | ||||||
|     if [[ $debianMajor == "8." ]]; then |     if [[ $debianMajor == "8" ]]; then | ||||||
|         debianName="jessie" |         debianName="jessie" | ||||||
|     elif [[ $debianMajor == "7." ]]; then |     elif [[ $debianMajor == "7" ]]; then | ||||||
|         debianName="wheezy" |         debianName="wheezy" | ||||||
|     else |     else | ||||||
|         debianName="unknown" |         debianName="unknown" | ||||||
| @@ -249,10 +249,13 @@ sudo sed -i 's/#ATALK_BGROUND=no/ATALK_BGROUND=yes/' /etc/default/netatalk | |||||||
| if [[ ! $(grep 'kernelRelease' /etc/init.d/netatalk) ]]; then | if [[ ! $(grep 'kernelRelease' /etc/init.d/netatalk) ]]; then | ||||||
|     sudo sed -i 's@\(\tif \[ x\"$ATALKD_RUN\)@\n\t# check for valid AppleTalk kernel module\n\t[[ $ATALKD_RUN == "yes" ]] \&\& { kernelRelease=$(uname -r); kernelMajor=$(cut -d "." -f 1  <<< $kernelRelease); kernelMinor=$(cut -d "." -f 2  <<< $kernelRelease | sed '"'"'s/\\(^[0-9]*\\)[^0-9].*$/\\1/'"'"'); kernelPatch=$(cut -d "." -f 3- <<< $kernelRelease | sed '"'"'s/\\(^[0-9]*\\)[^0-9].*$/\\1/'"'"'); [[ ( $kernelMajor -eq 3 \&\& $kernelMinor -ge 12 \&\& $kernelMinor -le 15 ) \&\& ( ! ( -f /usr/bin/raspi-config \&\& $kernelMinor -eq 12 \&\& $kernelPatch -ge 25 ) ) \&\& ( ( ! -f /lib/modules/$kernelRelease/kernel/net/appletalk/appletalk.ko ) || $(sha1sum /lib/modules/$kernelRelease/kernel/net/appletalk/appletalk.ko | cut -f 1 -d " ") != "ecb239fc084c36de93f6926e7749b80f6024f269" ) ]] \&\& { ATALKD_RUN=no; echo "[AppleTalk networking is not available.]" 1>\&2; } }\n\n\1@' /etc/init.d/netatalk |     sudo sed -i 's@\(\tif \[ x\"$ATALKD_RUN\)@\n\t# check for valid AppleTalk kernel module\n\t[[ $ATALKD_RUN == "yes" ]] \&\& { kernelRelease=$(uname -r); kernelMajor=$(cut -d "." -f 1  <<< $kernelRelease); kernelMinor=$(cut -d "." -f 2  <<< $kernelRelease | sed '"'"'s/\\(^[0-9]*\\)[^0-9].*$/\\1/'"'"'); kernelPatch=$(cut -d "." -f 3- <<< $kernelRelease | sed '"'"'s/\\(^[0-9]*\\)[^0-9].*$/\\1/'"'"'); [[ ( $kernelMajor -eq 3 \&\& $kernelMinor -ge 12 \&\& $kernelMinor -le 15 ) \&\& ( ! ( -f /usr/bin/raspi-config \&\& $kernelMinor -eq 12 \&\& $kernelPatch -ge 25 ) ) \&\& ( ( ! -f /lib/modules/$kernelRelease/kernel/net/appletalk/appletalk.ko ) || $(sha1sum /lib/modules/$kernelRelease/kernel/net/appletalk/appletalk.ko | cut -f 1 -d " ") != "ecb239fc084c36de93f6926e7749b80f6024f269" ) ]] \&\& { ATALKD_RUN=no; echo "[AppleTalk networking is not available.]" 1>\&2; } }\n\n\1@' /etc/init.d/netatalk | ||||||
| fi | fi | ||||||
|  | sudo sed -i 's/Starting Netatalk services (this will take a while): /Starting Netatalk services"\n\t\t\t[[ $ATALKD_RUN == "yes" ]] \&\& echo -n " (this will take 45 seconds)"\n\t\t\techo -n ":/' /etc/init.d/netatalk | ||||||
|  | sudo sed -i 's/Starting Netatalk services in the background./Netatalk services will be available in 45 seconds./' /etc/init.d/netatalk | ||||||
|  | sudo sed -i 's/-n "Restarting Netatalk Daemons (this will take a while)"/"Restarting Netatalk Daemons."/' /etc/init.d/netatalk | ||||||
|  |  | ||||||
| # enable MacIPgw support after launching atalkd | # enable MacIPgw support after launching atalkd | ||||||
| if ! grep -q -i 'macipgw' /etc/init.d/netatalk; then | if ! grep -q -i 'macipgw' /etc/init.d/netatalk; then | ||||||
|     sudo sed -i ':a;N;$!ba;s@\(echo -n " atalkd"\)\(.*# prepare\)@\1\n\n    # start MacIPgw (TCP over AppleTalk) service\n    ps aux | grep -q "[m]acipgw" \&\& sudo killall macipgw 2> /dev/null\n    atalkd_interface=$(grep "^[^ #]" /etc/netatalk/atalkd.conf | tail -1 | cut -d " " -f 1)\n    sysctl -w net.ipv4.ip_forward=1 > /dev/null\n    macipgw -n 8.8.8.8 192.168.151.0 255.255.255.0\n    /sbin/iptables -t nat -A POSTROUTING -o ${atalkd_interface} -j MASQUERADE\n    /sbin/iptables -A FORWARD -i ${atalkd_interface} -o tun0 -m state --state RELATED,ESTABLISHED -j ACCEPT\n    /sbin/iptables -A FORWARD -i tun1 -o ${atalkd_interface} -j ACCEPT\n\n    echo -n " macipgw"\n\2@' /etc/init.d/netatalk |     sudo sed -i ':a;N;$!ba;s@\(echo -n " atalkd"\)\(.*# prepare\)@\1\n\n\t\t# start MacIPgw (TCP over AppleTalk) service\n\t\tps aux | grep -q "[m]acipgw" \&\& sudo killall macipgw 2> /dev/null || :\n\t\tatalkd_interface=$(grep "^[^ #]" /etc/netatalk/atalkd.conf | tail -1 | cut -d " " -f 1)\n\t\tsysctl -w net.ipv4.ip_forward=1 > /dev/null\n\t\tmacipgw -n 8.8.8.8 192.168.151.0 255.255.255.0\n\t\t/sbin/iptables -t nat -A POSTROUTING -o ${atalkd_interface} -j MASQUERADE\n\t\t/sbin/iptables -A FORWARD -i ${atalkd_interface} -o tun0 -m state --state RELATED,ESTABLISHED -j ACCEPT\n\t\t/sbin/iptables -A FORWARD -i tun1 -o ${atalkd_interface} -j ACCEPT\n\n\t\techo -n " macipgw"\n\2@' /etc/init.d/netatalk | ||||||
|     sudo sed -i 's@\(start-stop-daemon --stop --quiet --oknodo --exec /usr/local/sbin/atalkd.*$\)@\1\n                    echo -n " macipgw"\n            sudo killall macipgw 2> /dev/null@' /etc/init.d/netatalk |     sudo sed -i 's@\(start-stop-daemon --stop --quiet --oknodo --exec /usr/local/sbin/atalkd.*$\)@\1\n                    echo -n " macipgw"\n            sudo killall macipgw 2> /dev/null@' /etc/init.d/netatalk | ||||||
| fi | fi | ||||||
|  |  | ||||||
| @@ -292,12 +295,12 @@ sudo sed -i 's/^~/#share1\n\n#share2/' \ | |||||||
| sudo sed -i 's/^:DEFAULT/#:DEFAULT/' \ | sudo sed -i 's/^:DEFAULT/#:DEFAULT/' \ | ||||||
| /usr/local/etc/netatalk/AppleVolumes.default | /usr/local/etc/netatalk/AppleVolumes.default | ||||||
|  |  | ||||||
| if [[ ! $(grep ^eth0 /usr/local/etc/netatalk/atalkd.conf) && ! $(grep ^wlan0 /usr/local/etc/netatalk/atalkd.conf) ]]; then | # if [[ ! $(grep ^eth0 /usr/local/etc/netatalk/atalkd.conf) && ! $(grep ^wlan0 /usr/local/etc/netatalk/atalkd.conf) ]]; then | ||||||
|  | if [[ $(tac /usr/local/etc/netatalk/atalkd.conf | sed '/./,$!d' | head -1 | cut -c 1) == "#" ]]; then | ||||||
|     # enable netatalk on the default network interface |     # enable netatalk on the default network interface | ||||||
|     # needs -router and -zone to prevent GS/OS AppleShare CDEV crash when used |     # needs -router and -zone to prevent GS/OS AppleShare CDEV crash when used | ||||||
|     # with Dayna or Asante bridges |     # with Dayna or Asante bridges | ||||||
|     echo -e 'eth0 -router -phase 2 -net 1 -zone "A2SERVER"' \ |     echo -e 'eth0 -router -phase 2 -net 1 -zone "A2SERVER"' | sudo tee -a /usr/local/etc/netatalk/atalkd.conf > /dev/null | ||||||
|     | sudo tee -a /usr/local/etc/netatalk/atalkd.conf > /dev/null |  | ||||||
| fi | fi | ||||||
|  |  | ||||||
| # Raspberry Pi | # Raspberry Pi | ||||||
| @@ -358,6 +361,7 @@ if [[ -d /srv/A2SERVER/A2FILES && ! -d /srv/A2SERVER/.a2files ]]; then | |||||||
|     mkdir /srv/A2SERVER/A2FILES |     mkdir /srv/A2SERVER/A2FILES | ||||||
|     sudo sed -i 's/casefold:toupper //' /usr/local/etc/netatalk/AppleVolumes.default 2> /dev/null |     sudo sed -i 's/casefold:toupper //' /usr/local/etc/netatalk/AppleVolumes.default 2> /dev/null | ||||||
|     sudo sed -i 's/^VOLCASEFOLD:.*/VOLCASEFOLD:/' /srv/A2SERVER/.a2files/.appledesktop/.volinfo 2> /dev/null |     sudo sed -i 's/^VOLCASEFOLD:.*/VOLCASEFOLD:/' /srv/A2SERVER/.a2files/.appledesktop/.volinfo 2> /dev/null | ||||||
|  |     sudo sed -i 's|/media/A2SHARED/A2FILES|/srv/A2SERVER/A2FILES|' /srv/A2SERVER/.a2files/.appledesktop/.volinfo 2> /dev/null | ||||||
| fi | fi | ||||||
|  |  | ||||||
| # 1.3.0: remove GSFILES if empty | # 1.3.0: remove GSFILES if empty | ||||||
| @@ -380,7 +384,7 @@ fi | |||||||
| # set up A2FILES case-insensitive share (for ProDOS 8 files, and GS/OS system) | # set up A2FILES case-insensitive share (for ProDOS 8 files, and GS/OS system) | ||||||
| sudo sed -i \ | sudo sed -i \ | ||||||
|     's/^#share2/\/srv\/A2SERVER\/A2FILES\ A2FILES options:prodos\ ea:ad/' \ |     's/^#share2/\/srv\/A2SERVER\/A2FILES\ A2FILES options:prodos\ ea:ad/' \ | ||||||
| /usr/local/etc/netatalk/AppleVolumes.default |         /usr/local/etc/netatalk/AppleVolumes.default | ||||||
| [[ -d /srv/A2SERVER/A2FILES ]] || mkdir -p /srv/A2SERVER/A2FILES | [[ -d /srv/A2SERVER/A2FILES ]] || mkdir -p /srv/A2SERVER/A2FILES | ||||||
| [[ -d /srv/A2SERVER/.a2files ]] || mkdir -p /srv/A2SERVER/.a2files | [[ -d /srv/A2SERVER/.a2files ]] || mkdir -p /srv/A2SERVER/.a2files | ||||||
|  |  | ||||||
| @@ -458,6 +462,8 @@ fi | |||||||
| # to make Netatalk start up when the server boots: | # to make Netatalk start up when the server boots: | ||||||
| sudo update-rc.d netatalk defaults &> /dev/null | sudo update-rc.d netatalk defaults &> /dev/null | ||||||
|  |  | ||||||
|  | # prepare shared volumes for use | ||||||
|  | afpsync -v < /dev/null | ||||||
|  |  | ||||||
| # --- Setting up users | # --- Setting up users | ||||||
|  |  | ||||||
| @@ -519,12 +525,12 @@ if [[ -f "/lib/modules/$kernelRelease/kernel/drivers/net/appletalk/ipddp.ko" ]]; | |||||||
|     sudo /etc/init.d/netatalk stop &> /dev/null |     sudo /etc/init.d/netatalk stop &> /dev/null | ||||||
|     sudo rmmod ipddp 2> /dev/null |     sudo rmmod ipddp 2> /dev/null | ||||||
|     sudo rmmod appletalk 2> /dev/null |     sudo rmmod appletalk 2> /dev/null | ||||||
|     echo "A2SERVER: Attempting to replace AppleTalk kernel module for MacIP use..." |     echo "A2SERVER: Replacing AppleTalk kernel module (IPDDP disabled) for MacIP use..." | ||||||
|  |  | ||||||
|     sudo mv /lib/modules/$kernelRelease/kernel/net/appletalk/appletalk.ko /tmp 2> /dev/null |     sudo mv /lib/modules/$kernelRelease/kernel/net/appletalk/appletalk.ko /tmp 2> /dev/null | ||||||
|  |  | ||||||
|     if [[ ${arch%_*} == "debian" ]]; then |     if [[ ${arch%_*} == "debian" ]]; then | ||||||
|         echo "A2SERVER: Attempting to fetch AppleTalk kernel module for Debian..." |         echo "A2SERVER: Fetching AppleTalk kernel module for Debian..." | ||||||
|         wget -qO /tmp/appletalk.tgz ${binaryURL}precompiled/appletalk-$kernelRelease-${arch}.tgz |         wget -qO /tmp/appletalk.tgz ${binaryURL}precompiled/appletalk-$kernelRelease-${arch}.tgz | ||||||
|         if [[ $? -eq 0 ]]; then |         if [[ $? -eq 0 ]]; then | ||||||
|             # if we found a prebuilt one on a2server site, install it and load it |             # if we found a prebuilt one on a2server site, install it and load it | ||||||
| @@ -552,7 +558,7 @@ if [[ -f "/lib/modules/$kernelRelease/kernel/drivers/net/appletalk/ipddp.ko" ]]; | |||||||
|  |  | ||||||
|         # kernel module compile adapted from from: http://askubuntu.com/a/338403/288003 |         # kernel module compile adapted from from: http://askubuntu.com/a/338403/288003 | ||||||
|         for i in 1; do |         for i in 1; do | ||||||
|             echo "A2SERVER: Attempting to build AppleTalk kernel module..." |             echo "A2SERVER: Building AppleTalk kernel module..." | ||||||
|             [[ -f /boot/config-$kernelRelease ]] || break |             [[ -f /boot/config-$kernelRelease ]] || break | ||||||
|             sudo apt-get -y install linux-headers-$kernelRelease linux-source-$kernelMajorMinor || break |             sudo apt-get -y install linux-headers-$kernelRelease linux-source-$kernelMajorMinor || break | ||||||
|             sudo apt-get -y install build-essential |             sudo apt-get -y install build-essential | ||||||
| @@ -636,7 +642,7 @@ if [[ ( ! $(ps aux | grep [a]talkd) ) && ( $isRpi ) ]]; then | |||||||
|  |  | ||||||
|     # if no AppleTalk module, try to download it from a2server site |     # 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 |     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..." |         echo "A2SERVER: Installing AppleTalk kernel module for Raspbian..." | ||||||
|         wget -qO /tmp/appletalk.ko.gz ${binaryURL}appletalk-$kernelRelease-rpi.ko.gz |         wget -qO /tmp/appletalk.ko.gz ${binaryURL}appletalk-$kernelRelease-rpi.ko.gz | ||||||
|         if [[ $? -eq 0 ]]; then |         if [[ $? -eq 0 ]]; then | ||||||
|             # if we found a prebuilt one on a2server site, install it and load it |             # if we found a prebuilt one on a2server site, install it and load it | ||||||
|   | |||||||
| @@ -9,12 +9,12 @@ | |||||||
|  |  | ||||||
| # 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" ;; | ||||||
| 	*) scriptURL="${A2SERVER_SCRIPT_URL:-http://ivanx.com/a2server}/" ;; |     *) scriptURL="${A2SERVER_SCRIPT_URL:-https://raw.githubusercontent.com/RasppleII/a2server/current}/" ;; | ||||||
| esac | esac | ||||||
| case "$A2SERVER_BINARY_URL" in | case "$A2SERVER_BINARY_URL" in | ||||||
| 	*/) binaryURL="$A2SERVER_BINARY_URL" ;; |     */) binaryURL="$A2SERVER_BINARY_URL" ;; | ||||||
| 	*) binaryURL="${A2SERVER_BINARY_URL:-http://ivanx.com/a2server/files}/" ;; |     *) binaryURL="${A2SERVER_BINARY_URL:-http://ivanx.com/a2server/files}/" ;; | ||||||
| esac | esac | ||||||
| useExternalURL=1 | useExternalURL=1 | ||||||
| [[ $A2SERVER_NO_EXTERNAL ]] && useExternalURL= | [[ $A2SERVER_NO_EXTERNAL ]] && useExternalURL= | ||||||
| @@ -28,49 +28,170 @@ p8Dir="/srv/A2SERVER/A2FILES" | |||||||
| diskToolsP8Dir=$p8Dir/Disk.Tools.P8 | diskToolsP8Dir=$p8Dir/Disk.Tools.P8 | ||||||
|  |  | ||||||
| commDir="/srv/A2SERVER/A2FILES/Comm" | commDir="/srv/A2SERVER/A2FILES/Comm" | ||||||
| spectrumDir=$commDir/Spectrum |  | ||||||
| protermDir=$commDir/ProTERM |  | ||||||
| zlinkDir=$commDir/Z.Link |  | ||||||
| adtproDir=$commDir/ADTPro |  | ||||||
|  |  | ||||||
| gsosURL="http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/English-North_American/Apple_II/Apple_IIGS_System_6.0.1/" | gsosURL="http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/English-North_American/Apple_II/Apple_IIGS_System_6.0.1/" | ||||||
| gsosBackupURL="http://archive.org/download/download.info.apple.com.2012.11/download.info.apple.com.2012.11.zip/download.info.apple.com%2FApple_Support_Area%2FApple_Software_Updates%2FEnglish-North_American%2FApple_II%2FApple_IIGS_System_6.0.1%2F" | gsosBackupURL="http://archive.org/download/download.info.apple.com.2012.11/download.info.apple.com.2012.11.zip/download.info.apple.com%2FApple_Support_Area%2FApple_Software_Updates%2FEnglish-North_American%2FApple_II%2FApple_IIGS_System_6.0.1%2F" | ||||||
|  |  | ||||||
| updateP8YearTables () {             | # --- bashByter library routines | ||||||
|     # Geoff Body and Andrew Roughan helped Joseph Carter with this one |  | ||||||
|     # Update ProDOS 8 year table (and spalsh date because may as well) | decToChar () { | ||||||
|     # Effectively, we're turning p8 into the 6.0.3 version here. | # converts single-byte decimal value to equivalent character | ||||||
|     wd=$PWD | # arg: decimal number from 0-255 | ||||||
|     cd /usr/local/etc/netatalk/a2boot | # out: one character | ||||||
|     echo -n -e "\xb0\xb2\xad\xc1\xf5\xe7\xad\xb1\xb5" | sudo dd of="p8" bs=38 seek=1 conv=notrunc 2> /dev/null | #exit: 8=extraneous arg, 11=missing arg, 21=invalid arg | ||||||
|     echo -n -e "\x12\x11\x0b\x10\x0f\x0e\x0d" | sudo dd of="p8" bs=3958 seek=1 conv=notrunc 2> /dev/null |     [[ $1 ]] || return 11 | ||||||
|     echo -n -e "\xb0\xb2\xad\xc1\xf5\xe7\xad\xb1\xb5" | sudo dd of="ProDOS16 Image" bs=3110 seek=1 conv=notrunc 2> /dev/null |     [[ $2 ]] && return 8 | ||||||
|     echo -n -e "\x12\x11\x0b\x10\x0f\x0e\x0d" | sudo dd of="ProDOS16 Image" bs=7030 seek=1 conv=notrunc 2> /dev/null |     [[ ( $(printf %d "$1" 2> /dev/null ) == $1 ) \ | ||||||
|     echo -n -e "\xb0\xb2\xad\xc1\xf5\xe7\xad\xb1\xb5" | sudo dd of="Apple :2f:2fe Boot Blocks" bs=79 seek=1 conv=notrunc 2> /dev/null |      && ( $1 -ge 0 ) && ( $1 -le 255 ) ]] || return 21 | ||||||
|     echo -n -e "\x12\x11\x0b\x10\x0f\x0e\x0d" | sudo dd of="Apple :2f:2fe Boot Blocks" bs=7071 seek=1 conv=notrunc 2> /dev/null |     # args are valid | ||||||
|     cd "$wd" |     echo -n -e "\x$(printf %02X "$1")" | ||||||
| } | } | ||||||
|  |  | ||||||
|  | charToDec () { | ||||||
|  | # converts single character to corresponding decimal value | ||||||
|  | # stdin OR arg: one character | ||||||
|  | #  [arg overrides stdin; stdin is required for NUL (0) or LF (0x0A)] | ||||||
|  | # out: decimal value from 0-255 | ||||||
|  | #exit: 8=extraneous arg, 9=invalid stdin, | ||||||
|  | #      11=missing stdin/arg, 21=invalid arg | ||||||
|  |     [[ ( ! -t 0 ) && $1 ]] && { cat > /dev/null; return 8; } | ||||||
|  |     [[ ( -t 0 ) ]] && { [[ $2 ]] && return 8; [[ $1 ]] || return 11; } | ||||||
|  |     # arg/stdin is potentially valid (additional check below) | ||||||
|  |     charX="$1X"; [[ $1 ]] || charX="$(cat; echo -n 'X';)" | ||||||
|  |     [[ ${#charX} -le 2 ]] || return $(( $([[ $1 ]]; echo $?) ? 9 : 21 )) | ||||||
|  |     # above line verifies that arg/stdin is valid | ||||||
|  |     [[ ${#charX} -ne 2 ]] && { echo -n 0; return 0; } | ||||||
|  |     echo -n "${charX:0:1}" | od -t u1 | \ | ||||||
|  |      head -1 | sed 's/[0\ ]*//' | tr -d ' \n' | ||||||
|  | } | ||||||
|  |  | ||||||
|  | # --- end bashByter | ||||||
|  |  | ||||||
| cpAD () { | cpAD () { | ||||||
|     # copy a file with its AppleDouble component in ./.AppleDouble |     # copy a file with its AppleDouble component in ./.AppleDouble | ||||||
|     # arg1 = source path, # arg2 = destination directory (not filename) |     # arg1 = source path, # arg2 = destination directory (not filename) | ||||||
|     cp -p "$1" "$2" |     afpsync= | ||||||
|  |     if [[ $1 == "-s" ]]; then | ||||||
|  |         afpsync=1 | ||||||
|  |         shift | ||||||
|  |     fi | ||||||
|  |     arg1="$1" | ||||||
|  |     [[ "$arg1" == *"/"* ]] || arg1="./$arg1" | ||||||
|  |     cp -p "$arg1" "$2" | ||||||
|     mkdir -p "$2"/.AppleDouble |     mkdir -p "$2"/.AppleDouble | ||||||
|     cp -p "${1%/*}"/.AppleDouble/"${1##*/}" "$2"/.AppleDouble |     cp -p "${arg1%/*}"/.AppleDouble/"${arg1##*/}" "$2"/.AppleDouble | ||||||
|     [[ $3 == "-s" ]] && afpsync -v > /dev/null |     [[ $afpsync ]] && afpsync -v > /dev/null | ||||||
|  | } | ||||||
|  |  | ||||||
|  | checkP8YearTables () { | ||||||
|  |     updateP8YearTables -c $1 | ||||||
|  |     return $? | ||||||
|  | } | ||||||
|  |  | ||||||
|  | updateP8YearTables () {             | ||||||
|  |     # JC: Geoff Body and Andrew Roughan helped Joseph Carter with this one | ||||||
|  |     # Update ProDOS 8 year table (and spalsh date because may as well) | ||||||
|  |     # Effectively, we're turning p8 into the 6.0.2 or 6.0.3 version here. | ||||||
|  |     # | ||||||
|  |     # ID: updates the year table for the Thunderclock driver in ProDOS 8; | ||||||
|  |     #     calculated from the day of week and date, as year is unavailable. | ||||||
|  |     #     accepts optional arguments for custom patches | ||||||
|  |     #     arg1 = year table, comma separated | ||||||
|  |     #     arg2 = date string for ProDOS splash screen in format "dd-Mmm-yy" | ||||||
|  |     #     OR for presets, arg1=602 or arg1=603, arg2 is empty | ||||||
|  |     check= | ||||||
|  |     if [[ $1 == "-c" ]]; then | ||||||
|  |         check=1 | ||||||
|  |         shift | ||||||
|  |     fi | ||||||
|  |     patch1="" | ||||||
|  |     patch2="" | ||||||
|  |     if [[ $1 == "602" ]]; then | ||||||
|  |         patch1=$(echo -n -e "\x12\x11\x0b\x10\x0f\x0e\x0d") | ||||||
|  |         patch2=$(echo -n -e "\xb2\xb2\xad\xca\xf5\xee\xad\xb1\xb5") | ||||||
|  |     elif [[ $1 == "603" ]]; then | ||||||
|  |         patch1=$(echo -n -e "\x12\x11\x0b\x10\x0f\x0e\x0d") | ||||||
|  |         patch2=$(echo -n -e "\xb0\xb2\xad\xc1\xf5\xe7\xad\xb1\xb5") | ||||||
|  |     elif [[ $1 ]]; then # year table supplied as seven comma-separated values | ||||||
|  |         for year in $(tr "," " " <<< $1); do | ||||||
|  |             patch1=${patch1}$(echo -n -e "\x$(printf %02X $year)") | ||||||
|  |         done | ||||||
|  |         if [[ $2 ]]; then # splash screen date supplied, convert to high-ascii bytes | ||||||
|  |             for c in $(sed "s/./& /g" <<< $2); do | ||||||
|  |                 patch2=${patch2}$(decToChar $(( $(charToDec $c) + 128 ))) | ||||||
|  |             done | ||||||
|  |         fi | ||||||
|  |     fi | ||||||
|  |  | ||||||
|  |     wd=$PWD | ||||||
|  |     cd /usr/local/etc/netatalk/a2boot | ||||||
|  |     files=("p8" "ProDOS16 Image" "Apple :2f:2fe Boot Blocks" "$gsosDir/System/P8") | ||||||
|  |     offset1=(3958 7030 7071 3958) # splash screen date | ||||||
|  |     offset2=(38 3110 79 38) # year table | ||||||
|  |      | ||||||
|  |     i=0 | ||||||
|  |     if [[ $check ]]; then | ||||||
|  |         # check if patched -- we're not actually doing this any more; we're always patching | ||||||
|  |         patched=0 # 0 is true in this case since it's the return value | ||||||
|  |         while (( $i < ${#files[@]} )); do | ||||||
|  |             [[ ! -f "${files[$i]}" ]] && { (( i++ )); continue; } | ||||||
|  |             if [[ ! $patch1 || $patch1 != $(sudo dd if="${files[$i]}" skip=${offset1[$i]} bs=1 count=7 2> /dev/null) ]]; then | ||||||
|  |                 patched=1 # 1 is false | ||||||
|  |                 break | ||||||
|  |             fi | ||||||
|  |             if [[ ! $patch2 || $patch2 != $(sudo dd if="${files[$i]}" skip=${offset2[$i]} bs=1 count=9 2> /dev/null) ]]; then | ||||||
|  |                 patched=1 # 1 is false | ||||||
|  |                 break | ||||||
|  |             fi | ||||||
|  |             (( i++ )) | ||||||
|  |         done | ||||||
|  |     else | ||||||
|  |         # perform patch | ||||||
|  |         while (( $i < ${#files[@]} )); do | ||||||
|  |             [[ ! -f "${files[$i]}" ]] && { (( i++ )); continue; } | ||||||
|  |             [[ $patch1 ]] && echo -n -e ${patch1} | sudo dd of="${files[$i]}" seek=${offset1[$i]} bs=1 conv=notrunc 2> /dev/null | ||||||
|  |             [[ $patch2 ]] && echo -n -e ${patch2} | sudo dd of="${files[$i]}" seek=${offset2[$i]} bs=1 conv=notrunc 2> /dev/null | ||||||
|  |             (( i++ )) | ||||||
|  |         done | ||||||
|  |         patched=0 # 0 is true | ||||||
|  |     fi | ||||||
|  |     return $patched | ||||||
|  |      | ||||||
|  |     # echo -n -e "\xb0\xb2\xad\xc1\xf5\xe7\xad\xb1\xb5" | sudo dd of="p8" bs=38 seek=1 conv=notrunc 2> /dev/null | ||||||
|  |     # echo -n -e "\x12\x11\x0b\x10\x0f\x0e\x0d" | sudo dd of="p8" bs=3958 seek=1 conv=notrunc 2> /dev/null | ||||||
|  |     # echo -n -e "\xb0\xb2\xad\xc1\xf5\xe7\xad\xb1\xb5" | sudo dd of="ProDOS16 Image" bs=3110 seek=1 conv=notrunc 2> /dev/null | ||||||
|  |     # echo -n -e "\x12\x11\x0b\x10\x0f\x0e\x0d" | sudo dd of="ProDOS16 Image" bs=7030 seek=1 conv=notrunc 2> /dev/null | ||||||
|  |     # echo -n -e "\xb0\xb2\xad\xc1\xf5\xe7\xad\xb1\xb5" | sudo dd of="Apple :2f:2fe Boot Blocks" bs=79 seek=1 conv=notrunc 2> /dev/null | ||||||
|  |     # echo -n -e "\x12\x11\x0b\x10\x0f\x0e\x0d" | sudo dd of="Apple :2f:2fe Boot Blocks" bs=7071 seek=1 conv=notrunc 2> /dev/null | ||||||
|  |  | ||||||
|  |     cd "$wd" | ||||||
| } | } | ||||||
|  |  | ||||||
| # 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-autoAnswerYes ]] && autoAnswerYes=1 || autoAnswerYes= | [[ -f /tmp/a2server-autoAnswerYes ]] && autoAnswerYes=1 || autoAnswerYes= | ||||||
|  |  | ||||||
|  | netbootInstalled= | ||||||
|  | if [[ -f /usr/local/etc/netatalk/a2boot/ProDOS16\ Boot\ Blocks && \ | ||||||
|  |     -f /usr/local/etc/netatalk/a2boot/ProDOS16\ Image && \ | ||||||
|  |     -f /usr/local/etc/netatalk/a2boot/Apple\ :2f:2fe\ Boot\ Blocks && \ | ||||||
|  |     -f /usr/local/etc/netatalk/a2boot/p8 && \ | ||||||
|  |     -f /usr/local/etc/netatalk/a2boot/Basic.System && \ | ||||||
|  |     -f $gsosDir/USERS/USER1/SETUP/ATINIT && \ | ||||||
|  |     -f $gsosDir/USERS/"<ANY USER>"/SETUP/ATINIT ]] ; then | ||||||
|  |     netbootInstalled=1 | ||||||
|  | fi | ||||||
|  | REPLY= | ||||||
| if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then | if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then | ||||||
|      |  | ||||||
|     if [[ ! $autoAnswerYes ]]; then |     if [[ ! $autoAnswerYes ]]; then | ||||||
|         echo |         if [[ ! $netbootInstalled ]]; then | ||||||
|         echo "Do you want to set up A2SERVER to be able to boot Apple II" |             echo | ||||||
|         echo -n "computers over the network? " |             echo "Do you want to set up A2SERVER to be able to boot Apple II" | ||||||
|         read |             echo -n "computers over the network? " | ||||||
|  |             read | ||||||
|  |         else | ||||||
|  |             echo "A2SERVER is already set up to boot Apple II computers over the network." | ||||||
|  |         fi | ||||||
|     fi     |     fi     | ||||||
|      |  | ||||||
|     if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then |     if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then | ||||||
|      |      | ||||||
|         nbmode=1 |         nbmode=1 | ||||||
| @@ -78,12 +199,15 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then | |||||||
|          |          | ||||||
|         sudo true |         sudo true | ||||||
|         mkdir -p /tmp/netboot |         mkdir -p /tmp/netboot | ||||||
|  |         rm -r /tmp/netboot/* 2> /dev/null | ||||||
|         cd /tmp/netboot |         cd /tmp/netboot | ||||||
|          |          | ||||||
|         # this will get "Disk 7" (Apple II Setup) as a raw (block dump) image |         # this will get "Disk 7" (Apple II Setup) as a raw (block dump) image | ||||||
|         if [[ ! -f /usr/local/etc/netatalk/a2boot/ProDOS16\ Boot\ Blocks ]] \ |         if [[ ! -f /usr/local/etc/netatalk/a2boot/ProDOS16\ Boot\ Blocks ]] \ | ||||||
|         || [[ ! -f /usr/local/etc/netatalk/a2boot/ProDOS16\ Image ]] \ |         || [[ ! -f /usr/local/etc/netatalk/a2boot/ProDOS16\ Image ]] \ | ||||||
|         || [[ ! -f /usr/local/etc/netatalk/a2boot/Apple\ :2f:2fe\ Boot\ Blocks ]]; then |         || [[ ! -f /usr/local/etc/netatalk/a2boot/Apple\ :2f:2fe\ Boot\ Blocks ]] \ | ||||||
|  |         || [[ ! -f /usr/local/etc/netatalk/a2boot/p8 ]] \ | ||||||
|  |         || [[ ! -f /usr/local/etc/netatalk/a2boot/Basic.System ]]; then | ||||||
|             echo "A2SERVER: Downloading Apple II Boot Blocks..." |             echo "A2SERVER: Downloading Apple II Boot Blocks..." | ||||||
|             cd /tmp/netboot |             cd /tmp/netboot | ||||||
|              |              | ||||||
| @@ -102,10 +226,10 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then | |||||||
|             truncate -s 819284 'Disk 7 of 7-Apple II Setup.sea' |             truncate -s 819284 'Disk 7 of 7-Apple II Setup.sea' | ||||||
|             dd if='Disk 7 of 7-Apple II Setup.sea' of=APPLE2SETUP.HDV bs=84 skip=1 2> /dev/null |             dd if='Disk 7 of 7-Apple II Setup.sea' of=APPLE2SETUP.HDV bs=84 skip=1 2> /dev/null | ||||||
|                  |                  | ||||||
|             # copy the Boot Blocks into the right place |  | ||||||
|             mkdir -p a2setup |             mkdir -p a2setup | ||||||
|             sudo mount -t hfs -o ro,loop APPLE2SETUP.HDV a2setup |             sudo mount -t hfs -o ro,loop APPLE2SETUP.HDV a2setup | ||||||
|             sudo mkdir -p /usr/local/etc/netatalk/a2boot |             sudo mkdir -p /usr/local/etc/netatalk/a2boot | ||||||
|  |             sudo rm -r /usr/local/etc/netatalk/a2boot/* 2> /dev/null | ||||||
|             sudo cp -p a2setup/System\ Folder/* /usr/local/etc/netatalk/a2boot |             sudo cp -p a2setup/System\ Folder/* /usr/local/etc/netatalk/a2boot | ||||||
|             sudo umount a2setup |             sudo umount a2setup | ||||||
|             sudo mv /usr/local/etc/netatalk/a2boot/Apple* /usr/local/etc/netatalk/a2boot/'Apple :2f:2fe Boot Blocks' |             sudo mv /usr/local/etc/netatalk/a2boot/Apple* /usr/local/etc/netatalk/a2boot/'Apple :2f:2fe Boot Blocks' | ||||||
| @@ -148,8 +272,8 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then | |||||||
|             echo |             echo | ||||||
|             echo "A2SERVER: Creating NETBOOT.P8..." |             echo "A2SERVER: Creating NETBOOT.P8..." | ||||||
|             touch $p8Dir/NETBOOT.P8 |             touch $p8Dir/NETBOOT.P8 | ||||||
|             echo -n -e "\x38\x20\x1f\xfe\x90\x01\x60\xfb\x08\xc2\x30\xf4\x02\x00\xf4\x62\x00\xa2\x03\x0b\x22\x00\x00\xe1\x78\xf4\x00\x00\xf4\x00\x00\xab\xab\x2b\x38\xfb\xce\xf4\x03\xa9\x0c\x8d\x68\xc0\x9c\x47\xc0\x9c\x41\xc0\xa9\x09\x8d\x39\xc0\xa9\xc0\x8d\x39\xc0\x5c\x62\xfa\x00" | \ |             echo -n -e "\x38\x20\x1f\xfe\x90\x01\x60\xfb\x08\xc2\x30\xf4\x02\x00\xf4\x62\x00\xa2\x03\x0b\x22\x00\x00\xe1\x78\xf4\x00\x00\xf4\x00\x00\xab\xab\x2b\x38\xfb\xce\xf4\x03\xa9\x0c\x8d\x68\xc0\x9c\x47\xc0\x9c\x41\xc0\xa9\x09\x8d\x39\xc0\xa9\xc0\x8d\x39\xc0\x5c\x62\xfa\x00" \ | ||||||
|               sudo dd of="$p8Dir/NETBOOT.P8" 2> /dev/null |             | sudo dd of="$p8Dir/NETBOOT.P8" 2> /dev/null | ||||||
|             afpsync -v $p8Dir > /dev/null |             afpsync -v $p8Dir > /dev/null | ||||||
|             afptype -p SYS -q $p8Dir/NETBOOT.P8 |             afptype -p SYS -q $p8Dir/NETBOOT.P8 | ||||||
|         fi |         fi | ||||||
| @@ -158,8 +282,8 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then | |||||||
|             echo "A2SERVER: Creating NETBOOT.GSOS..." |             echo "A2SERVER: Creating NETBOOT.GSOS..." | ||||||
|             # create tool for setting GSOS boot in battery RAM and rebooting. Props yet again to Geoff Body. |             # create tool for setting GSOS boot in battery RAM and rebooting. Props yet again to Geoff Body. | ||||||
|             touch $gsosDir/NETBOOT.GSOS |             touch $gsosDir/NETBOOT.GSOS | ||||||
|             echo -n -e "\x38\x20\x1f\xfe\x90\x01\x60\xfb\x08\xc2\x30\xf4\x01\x00\xf4\x62\x00\xa2\x03\x0b\x22\x00\x00\xe1\x78\xf4\x00\x00\xf4\x00\x00\xab\xab\x2b\x38\xfb\xce\xf4\x03\xa9\x0c\x8d\x68\xc0\x9c\x47\xc0\x9c\x41\xc0\xa9\x09\x8d\x39\xc0\xa9\xc0\x8d\x39\xc0\x5c\x62\xfa\x00" | \ |             echo -n -e "\x38\x20\x1f\xfe\x90\x01\x60\xfb\x08\xc2\x30\xf4\x01\x00\xf4\x62\x00\xa2\x03\x0b\x22\x00\x00\xe1\x78\xf4\x00\x00\xf4\x00\x00\xab\xab\x2b\x38\xfb\xce\xf4\x03\xa9\x0c\x8d\x68\xc0\x9c\x47\xc0\x9c\x41\xc0\xa9\x09\x8d\x39\xc0\xa9\xc0\x8d\x39\xc0\x5c\x62\xfa\x00" \ | ||||||
|               sudo dd of="$p8Dir/NETBOOT.GSOS" 2> /dev/null |             | sudo dd of="$p8Dir/NETBOOT.GSOS" 2> /dev/null | ||||||
|             afpsync -v $gsosDir > /dev/null |             afpsync -v $gsosDir > /dev/null | ||||||
|             afptype -p SYS -q $gsosDir/NETBOOT.GSOS |             afptype -p SYS -q $gsosDir/NETBOOT.GSOS | ||||||
|         fi |         fi | ||||||
| @@ -167,6 +291,10 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then | |||||||
|         mkatinit -gs -d -f     # GS/OS registered user and Guest starts up with SYSTEM/FINDER |         mkatinit -gs -d -f     # GS/OS registered user and Guest starts up with SYSTEM/FINDER | ||||||
|         mkatinit -d -f guest   # ProDOS 8 Guest starts up with BASIC.SYSTEM (no registered user) |         mkatinit -d -f guest   # ProDOS 8 Guest starts up with BASIC.SYSTEM (no registered user) | ||||||
|  |  | ||||||
|  |         netbootInstalled=1 | ||||||
|  |     fi | ||||||
|  |  | ||||||
|  |     if [[ $netbootInstalled ]]; then | ||||||
|         gsosInstall= |         gsosInstall= | ||||||
|         gsosReinstall=1 |         gsosReinstall=1 | ||||||
|         if [[ -f "$gsosDir/SYSTEM/START.GS.OS" ]]; then |         if [[ -f "$gsosDir/SYSTEM/START.GS.OS" ]]; then | ||||||
| @@ -188,7 +316,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then | |||||||
|                         echo -n "Are you sure you want to delete your entire GS/OS System folder? " |                         echo -n "Are you sure you want to delete your entire GS/OS System folder? " | ||||||
|                         read |                         read | ||||||
|                         if [[ ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then |                         if [[ ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then | ||||||
|                             rm -r "$gsosDir/SYSTEM/* $gsosDir/System/.AppleDouble/*" 2> /dev/null |                             rm -r "$gsosDir/System"/* "$gsosDir/System/.AppleDouble"/* 2> /dev/null | ||||||
|                             afpsync &> /dev/null |                             afpsync &> /dev/null | ||||||
|                             echo |                             echo | ||||||
|                             break |                             break | ||||||
| @@ -197,7 +325,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then | |||||||
|                         echo -n "Are you sure you want to reinstall GS/OS over your existing system? " |                         echo -n "Are you sure you want to reinstall GS/OS over your existing system? " | ||||||
|                         read |                         read | ||||||
|                         if [[ ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then |                         if [[ ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then | ||||||
|                             rm -r "$gsosDir/SYSTEM/START.GS.OS $gsosDir/System/.AppleDouble/START.GS.OS" 2> /dev/null |                             rm -r "$gsosDir/System/Start.GS.OS $gsosDir/System/.AppleDouble/Start.GS.OS" 2> /dev/null | ||||||
|                             afpsync &> /dev/null |                             afpsync &> /dev/null | ||||||
|                             echo |                             echo | ||||||
|                             break |                             break | ||||||
| @@ -212,11 +340,22 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then | |||||||
|  |  | ||||||
|         if [[ $gsosReinstall ]]; then |         if [[ $gsosReinstall ]]; then | ||||||
|             if [[ ! $autoAnswerYes ]]; then |             if [[ ! $autoAnswerYes ]]; then | ||||||
|  |                 echo | ||||||
|                 echo "You can set up GS/OS for network boot. This may take a while." |                 echo "You can set up GS/OS for network boot. This may take a while." | ||||||
|                 echo "0: don't install GS/OS" |                 echo | ||||||
|                 echo "1: GS/OS 6.0.1 (official Apple release, May 1993)" |                 echo "  0: don't install GS/OS" | ||||||
|                 echo "2: GS/OS 6.0.2 (community release by Antoine Vignau, July 2015)" |                 echo "  1: GS/OS 6.0.1 (May 1993) [official release]" | ||||||
|                 echo "3: GS/OS 6.0.3 (community release by Tony Diaz, August 2015)" |                 echo "     The final version authorized by Apple.  It has a few bugs," | ||||||
|  |                 echo "     but most of these can be patched.  Predictable and might be" | ||||||
|  |                 echo "     required if you use certain patches." | ||||||
|  |                 echo "  2: GS/OS 6.0.2 (Jul 2015)" | ||||||
|  |                 echo "     A community effort released by Antoine Vignau with fixes for" | ||||||
|  |                 echo "     some serious bugs and a few other enhancements." | ||||||
|  |                 echo "  3: GS/OS 6.0.3 (Aug 2015)" | ||||||
|  |                 echo "     Continuing community effort released by Tony Diaz. Includes" | ||||||
|  |                 echo "     previous work along with additional fixes/changes. Better" | ||||||
|  |                 echo "     documentation of changes. Most will prefer this or Apple's" | ||||||
|  |                 echo "     release above." | ||||||
|                 echo |                 echo | ||||||
|                 echo -n "Which flavor would you like? " |                 echo -n "Which flavor would you like? " | ||||||
|                 read |                 read | ||||||
| @@ -234,6 +373,8 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then | |||||||
|                 # echo |                 # echo | ||||||
|                 echo |                 echo | ||||||
|                 echo "A2SERVER: Downloading GS/OS 6.0.${gsosInstall} installer disk images..." |                 echo "A2SERVER: Downloading GS/OS 6.0.${gsosInstall} installer disk images..." | ||||||
|  |                 mkdir -p /tmp/netboot | ||||||
|  |                 rm -r /tmp/netboot/* 2> /dev/null | ||||||
|                 cd /tmp/netboot |                 cd /tmp/netboot | ||||||
|                 mkdir -p $imagesDir |                 mkdir -p $imagesDir | ||||||
|                 mkdir -p $netInstallDir |                 mkdir -p $netInstallDir | ||||||
| @@ -251,8 +392,8 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then | |||||||
|                 fi |                 fi | ||||||
|      |      | ||||||
|                 # delete previously downloaded installer |                 # delete previously downloaded installer | ||||||
|                 rm "$imagesDir/* $imagesDir/.AppleDouble/*" 2> /dev/null |                 rm "$imagesDir/* $imagesDir/.AppleDouble"/* 2> /dev/null | ||||||
|                 rm "$netInstallDir/* $netInstallDir/.AppleDouble/*" 2> /dev/null |                 rm "$netInstallDir/* $netInstallDir/.AppleDouble"/* 2> /dev/null | ||||||
|                 afpsync -v $gsosDir > /dev/null |                 afpsync -v $gsosDir > /dev/null | ||||||
|      |      | ||||||
|                 for diskname in ${diskNames[@]}; do |                 for diskname in ${diskNames[@]}; do | ||||||
| @@ -345,6 +486,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then | |||||||
|                 } |                 } | ||||||
|                  |                  | ||||||
|                 mkdir -p /tmp/netboot |                 mkdir -p /tmp/netboot | ||||||
|  |                 rm -r /tmp/netboot/* 2> /dev/null | ||||||
|                 cd /tmp/netboot |                 cd /tmp/netboot | ||||||
|      |      | ||||||
|                 echo "A2SERVER: Preparing GS/OS installer scripts..."     |                 echo "A2SERVER: Preparing GS/OS installer scripts..."     | ||||||
| @@ -369,105 +511,133 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then | |||||||
|             fi |             fi | ||||||
|         fi |         fi | ||||||
|          |          | ||||||
|         if [[ ! $autoAnswerYes && gsosInstall -lt 2 ]]; then |         # if [[ ! $autoAnswerYes && (! $gsosInstall || $gsosInstall -lt 2) ]] && ! checkP8YearTables 603; then | ||||||
|             echo |         #     echo | ||||||
|             echo -n "Do you want to update the ProDOS 8 year tables? " |         #     echo -n "Do you want to update the ProDOS 8 Thunderclock year table? " | ||||||
|             read |         #     read | ||||||
|         fi |         # fi | ||||||
|         if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then |         # if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then | ||||||
|             updateP8YearTables |         #    updateP8YearTables 603 | ||||||
|         fi |         # elif [[ $gsosInstall -ge 2 ]]; then | ||||||
|  |         #    updateP8YearTables 60${gsosInstall} | ||||||
|  |         # fi | ||||||
|  |  | ||||||
|  |         # patch ProDOS 8 Thunderclock driver year table based on today's date | ||||||
|  |         echo | ||||||
|  |         echo "A2SERVER: Updating ProDOS 8 Thunderclock driver year table..." | ||||||
|  |         mkdir -p /tmp/netboot | ||||||
|  |         rm -r /tmp/netboot/* 2> /dev/null | ||||||
|  |         wget -qO /tmp/netboot/clock.patch.py "${scriptURL}scripts/clock.patch.py" | ||||||
|  |         updateP8YearTables $(python /tmp/netboot/clock.patch.py $(LANG=C date +"%a %m/%d/%y")) | ||||||
|  |  | ||||||
|  |         gsosInstalled="" | ||||||
|  |         [[ -f "$gsosDir/System/Start.GS.OS" ]] && gsosInstalled="GS/OS and " | ||||||
|  |         p8ToolsInstalled= | ||||||
|  |         [[ -f $diskToolsP8Dir/SHRINKIT && -f $diskToolsP8Dir/DSK2FILE && -f $diskToolsP8Dir/SYSUTIL ]] && p8ToolsInstalled=1 | ||||||
|  |         gsosToolsInstalled= | ||||||
|  |         [[ -f $imageToolsDir/Asimov && -f $gsosDir/System/System.Setup/MountIt && -f $imageToolsDir/GSHK ]] && gsosToolsInstalled=1 | ||||||
|  |         toolsInstalled= | ||||||
|  |         if [[ $gsosInstalled ]]; then | ||||||
|  |             [[ $gsosToolsInstalled && $p8ToolsInstalled ]] && toolsInstalled=1 | ||||||
|  |         else | ||||||
|  |             toolsInstalled=$p8ToolsInstalled | ||||||
|  |         fi | ||||||
|  |         REPLY= | ||||||
|         if [[ ! $autoAnswerYes ]]; then |         if [[ ! $autoAnswerYes ]]; then | ||||||
|             echo |             if [[ ! $toolsInstalled ]]; then | ||||||
|             echo "Do you want to download and install utilities for working with" |                 echo | ||||||
|             echo -n "disk images and archive files in GS/OS? " |                 echo "Do you want to download and install utilities for working with" | ||||||
|             read |                 echo -n "disk images and archive files in ${gsosInstalled}ProDOS 8? " | ||||||
|  |                 read | ||||||
|  |             else | ||||||
|  |                 echo | ||||||
|  |                 echo "A2SERVER: Disk image and archive utilities are already installed." | ||||||
|  |             fi | ||||||
|         fi |         fi | ||||||
|  |         if [[ $gsosInstalled ]]; then | ||||||
|  |             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..." | ||||||
|  |                 mkdir -p $imageToolsDir | ||||||
|  |          | ||||||
|  |                 # get Asimov2 (for GS/OS) | ||||||
|  |                 echo -n "Asimov 2.0" | ||||||
|  |                 if [[ -f $imageToolsDir/Asimov ]]; then | ||||||
|  |                     echo " is already installed." | ||||||
|  |                 else | ||||||
|  |                     echo | ||||||
|  |                     cd /tmp/netboot | ||||||
|  |                     if [[ $useExternalURL ]]; then | ||||||
|  |                         wget -qO Asimov.shk http://www.ninjaforce.com/downloads/Asimov.shk | ||||||
|  |                         nulib2 -x -s Asimov.shk &> /dev/null | ||||||
|  |                     fi | ||||||
|  |                     if [[ ! -d Asimov ]]; then | ||||||
|  |                         wget -qO Asimov.shk ${binaryURL}external/appleii/Asimov.shk | ||||||
|  |                         nulib2 -x -s Asimov.shk &> /dev/null | ||||||
|  |                     fi | ||||||
|  |                     cp -p Asimov/Asimov $imageToolsDir/Asimov | ||||||
|  |                     afpsync -v $gsosDir > /dev/null | ||||||
|  |                     cat Asimov/Asimov_rsrc_ >> $imageToolsDir/.AppleDouble/Asimov | ||||||
|  |                     afptype -p S16 -q $imageToolsDir/Asimov | ||||||
|  |                 fi | ||||||
|  |              | ||||||
|  |                 echo -n "GS-ShrinkIt 1.1" | ||||||
|  |                 # get GS-ShrinkIt | ||||||
|  |                 if [[ -f $imageToolsDir/GSHK ]]; then | ||||||
|  |                     echo " is already installed." | ||||||
|  |                 else | ||||||
|  |                     echo | ||||||
|  |                     mkdir -p /tmp/netboot/gshk | ||||||
|  |                     cd /tmp/netboot/gshk | ||||||
|  |                     if [[ $useExternalURL ]]; then | ||||||
|  |                         wget -qO gshk11.sea http://www.nulib.com/library/gshk11.sea | ||||||
|  |                         if (( $? != 0 )); then | ||||||
|  |                             wget -qO gshk11.sea http://web.archive.org/web/20131031160750/http://nulib.com/library/gshk11.sea | ||||||
|  |                         fi | ||||||
|  |                         nulib2 -x -s gshk11.sea &> /dev/null | ||||||
|  |                     fi | ||||||
|  |                     if [[ ! -f GSHK ]]; then | ||||||
|  |                         wget -qO gshk11.sea ${binaryURL}external/appleii/gshk11.sea | ||||||
|  |                         nulib2 -x -s gshk11.sea &> /dev/null | ||||||
|  |                     fi | ||||||
|  |                     cp -p GSHK $imageToolsDir/GSHK | ||||||
|  |                     afpsync -v $gsosDir > /dev/null | ||||||
|  |                     cat GSHK_rsrc_ >> $imageToolsDir/.AppleDouble/GSHK | ||||||
|  |                     afptype -p S16 -a DB07 -q $imageToolsDir/GSHK | ||||||
|  |                     cd /tmp/netboot | ||||||
|  |                 fi | ||||||
|  |          | ||||||
|  |                 echo -n "MountIt 1.4"     | ||||||
|  |                 # get MountIt (for GS/OS) | ||||||
|  |                 if [[ -f $gsosDir/System/System.Setup/MountIt ]]; then | ||||||
|  |                     echo " is already installed." | ||||||
|  |                 else | ||||||
|  |                     echo | ||||||
|  |                     mkdir -p /tmp/netboot/mountit | ||||||
|  |                     cd /tmp/netboot/mountit | ||||||
|  |                     if [[ $useExternalURL ]]; then | ||||||
|  |                         wget -q -O MOUNTIT.SHK http://www.brutaldeluxe.fr/products/apple2gs/MOUNTIT.SHK | ||||||
|  |                         if (( $? != 0 )); then | ||||||
|  |                             wget -q -O http://web.archive.org/web/20150201044930/http://brutaldeluxe.fr/products/apple2gs/MOUNTIT.SHK | ||||||
|  |                         fi | ||||||
|  |                         cppo -s -ad MOUNTIT.SHK System:System.Setup:MountIt . &> /dev/null | ||||||
|  |                         cppo -s -ad MOUNTIT.SHK ReadMe . &> /dev/null | ||||||
|  |                     fi | ||||||
|  |                     if [[ ! -f ReadMe ]]; then | ||||||
|  |                         wget -qO MOUNTIT.SHK ${binaryURL}external/appleii/MOUNTIT.SHK | ||||||
|  |                         cppo -s -ad MOUNTIT.SHK System:System.Setup:MountIt . &> /dev/null | ||||||
|  |                         cppo -s -ad MOUNTIT.SHK ReadMe . &> /dev/null | ||||||
|  |                     fi | ||||||
|  |                     cpAD ./MountIt $gsosDir/System/System.Setup | ||||||
|  |                     mkdir -p $gsosDir/GSOS.Installer/Image.Tools/MountIt | ||||||
|  |                     cpAD ./ReadMe $gsosDir/GSOS.Installer/Image.Tools/MountIt | ||||||
|  |                     afpsync -v $gsosDir > /dev/null | ||||||
|  |                 fi | ||||||
|  |             fi | ||||||
|  |         fi | ||||||
|  |  | ||||||
|         if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then |         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..." |  | ||||||
|             mkdir -p $imageToolsDir |  | ||||||
|      |  | ||||||
|             # get Asimov2 (for GS/OS) |  | ||||||
|             echo -n "Asimov 2.0" |  | ||||||
|             if [[ -f $imageToolsDir/Asimov ]]; then |  | ||||||
|                 echo " is already installed." |  | ||||||
|             else |  | ||||||
|                 echo |  | ||||||
|                 cd /tmp/netboot |  | ||||||
|                 if [[ $useExternalURL ]]; then |  | ||||||
|                     wget -qO Asimov.shk http://www.ninjaforce.com/downloads/Asimov.shk |  | ||||||
|                     nulib2 -x -s Asimov.shk &> /dev/null |  | ||||||
|                 fi |  | ||||||
|                 if [[ ! -d Asimov ]]; then |  | ||||||
|                     wget -qO Asimov.shk ${binaryURL}external/appleii/Asimov.shk |  | ||||||
|                     nulib2 -x -s Asimov.shk &> /dev/null |  | ||||||
|                 fi |  | ||||||
|                 cp -p Asimov/Asimov $imageToolsDir/Asimov |  | ||||||
|                 afpsync -v $gsosDir > /dev/null |  | ||||||
|                 cat Asimov/Asimov_rsrc_ >> $imageToolsDir/.AppleDouble/Asimov |  | ||||||
|                 afptype -p S16 -q $imageToolsDir/Asimov |  | ||||||
|             fi |  | ||||||
|          |  | ||||||
|             echo -n "GS-ShrinkIt 1.1" |  | ||||||
|             # get GS-ShrinkIt |  | ||||||
|             if [[ -f $imageToolsDir/GSHK ]]; then |  | ||||||
|                 echo " is already installed." |  | ||||||
|             else |  | ||||||
|                 echo |  | ||||||
|                 mkdir -p /tmp/netboot/gshk |  | ||||||
|                 cd /tmp/netboot/gshk |  | ||||||
|                 if [[ $useExternalURL ]]; then |  | ||||||
|                     wget -qO gshk11.sea http://web.archive.org/web/20131031160750/http://nulib.com/library/gshk11.sea |  | ||||||
|                     #wget -qO gshk11.sea http://www.nulib.com/library/gshk11.sea |  | ||||||
|                     nulib2 -x -s gshk11.sea &> /dev/null |  | ||||||
|                 fi |  | ||||||
|                 if [[ ! -f GSHK ]]; then |  | ||||||
|                     wget -qO gshk11.sea ${binaryURL}external/appleii/gshk11.sea |  | ||||||
|                     nulib2 -x -s gshk11.sea &> /dev/null |  | ||||||
|                 fi |  | ||||||
|                 cp -p GSHK $imageToolsDir/GSHK |  | ||||||
|                 afpsync -v $gsosDir > /dev/null |  | ||||||
|                 cat GSHK_rsrc_ >> $imageToolsDir/.AppleDouble/GSHK |  | ||||||
|                 afptype -p S16 -a DB07 -q $imageToolsDir/GSHK |  | ||||||
|                 cd /tmp/netboot |  | ||||||
|             fi |  | ||||||
|      |  | ||||||
|             echo -n "MountIt 1.4"     |  | ||||||
|             # get MountIt (for GS/OS) |  | ||||||
|             if [[ -f $imageToolsDir/MOUNTIT.SHK ]]; then |  | ||||||
|                 echo " is already installed." |  | ||||||
|             else |  | ||||||
|                 echo |  | ||||||
|                 mkdir -p /tmp/netboot/mountit |  | ||||||
|                 cd /tmp/netboot/mountit |  | ||||||
|                 if [[ $useExternalURL ]]; then |  | ||||||
|                     wget -q -O MOUNTIT.SHK http://www.brutaldeluxe.fr/products/apple2gs/MOUNTIT.SHK |  | ||||||
|                     cppo -s -ad MOUNTIT.SHK System:System.Setup:MountIt . &> /dev/null |  | ||||||
|                     cppo -s -ad MOUNTIT.SHK ReadMe . &> /dev/null |  | ||||||
|                 fi |  | ||||||
|                 if [[ ! -f ReadMe ]]; then |  | ||||||
|                     wget -qO MOUNTIT.SHK ${binaryURL}external/appleii/MOUNTIT.SHK |  | ||||||
|                     cppo -s -ad MOUNTIT.SHK System:System.Setup:MountIt . &> /dev/null |  | ||||||
|                     cppo -s -ad MOUNTIT.SHK ReadMe . &> /dev/null |  | ||||||
|                 fi |  | ||||||
|                 cpAD ./MountIt $gsosDir/System/System.Setup |  | ||||||
|                 mkdir -p $gsosDir/GSOS.Installer/Image.Tools/MountIt |  | ||||||
|                 cpAD ./ReadMe $gsosDir/GSOS.Installer/Image.Tools/MountIt |  | ||||||
|                 afpsync -v $gsosDir > /dev/null |  | ||||||
|             fi |  | ||||||
|         fi |  | ||||||
|  |  | ||||||
|         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..." |             echo "A2SERVER: Downloading ProDOS 8 disk image utilities..." | ||||||
|  |  | ||||||
|             mkdir -p $diskToolsP8Dir |             mkdir -p $diskToolsP8Dir | ||||||
| @@ -480,14 +650,17 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then | |||||||
|                 echo |                 echo | ||||||
|                 cd /tmp/netboot |                 cd /tmp/netboot | ||||||
|                 if [[ $useExternalURL ]]; then |                 if [[ $useExternalURL ]]; then | ||||||
|                     wget -qO shrinkit.sdk http://web.archive.org/web/20131031160750/http://www.nulib.com/library/shrinkit.sdk |                     wget -qO shrinkit.sdk http://www.nulib.com/library/shrinkit.sdk | ||||||
|                     nulib2 -x -s shrinkit.sdk &> /dev/null |                     if (( $? != 0 )); then | ||||||
|  |                         wget -qO shrinkit.sdk http://web.archive.org/web/20131031160750/http://www.nulib.com/library/shrinkit.sdk | ||||||
|  |                     fi | ||||||
|  |                     nulib2 -x -s -e shrinkit.sdk &> /dev/null | ||||||
|                 fi |                 fi | ||||||
|                 if [[ ! -f SHRINKIT ]]; then |                 if [[ ! -f "SHRINKIT#000118i" ]]; then | ||||||
|                     wget -qO shrinkit.sdk ${binaryURL}external/appleii/shrinkit.sdk |                     wget -qO shrinkit.sdk ${binaryURL}external/appleii/shrinkit.sdk | ||||||
|                     nulib2 -x -s shrinkit.sdk &> /dev/null |                     nulib2 -x -s -e shrinkit.sdk &> /dev/null | ||||||
|                 fi |                 fi | ||||||
|                 cppo -s -ad SHRINKIT /SHRINKIT/SHRINKIT $diskToolsP8Dir &> /dev/null |                 cppo -s -ad "SHRINKIT#000118i" /SHRINKIT/SHRINKIT $diskToolsP8Dir &> /dev/null | ||||||
|                 afpsync -v $sharepath > /dev/null |                 afpsync -v $sharepath > /dev/null | ||||||
|             fi |             fi | ||||||
|          |          | ||||||
| @@ -521,8 +694,8 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then | |||||||
|                     wget --max-redirect 0 -qO Apple_II_System_Disk_3.2.sea.bin http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/English-North_American/Apple_II/Apple_II_Supplemental/Apple_II_System_Disk_3.2.sea.bin |                     wget --max-redirect 0 -qO Apple_II_System_Disk_3.2.sea.bin http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/English-North_American/Apple_II/Apple_II_Supplemental/Apple_II_System_Disk_3.2.sea.bin | ||||||
|                     if (( $? != 0 )); then |                     if (( $? != 0 )); then | ||||||
|                         wget -qO Apple_II_System_Disk_3.2.sea.bin http://archive.org/download/download.info.apple.com.2012.11/download.info.apple.com.2012.11.zip/download.info.apple.com%2FApple_Support_Area%2FApple_Software_Updates%2FEnglish-North_American%2FApple_II%2FApple_II_Supplemental%2FApple_II_System_Disk_3.2.sea.bin |                         wget -qO Apple_II_System_Disk_3.2.sea.bin http://archive.org/download/download.info.apple.com.2012.11/download.info.apple.com.2012.11.zip/download.info.apple.com%2FApple_Support_Area%2FApple_Software_Updates%2FEnglish-North_American%2FApple_II%2FApple_II_Supplemental%2FApple_II_System_Disk_3.2.sea.bin | ||||||
|                         unar -k skip Apple_II_System_Disk_3.2.sea.bin &> /dev/null |  | ||||||
|                     fi |                     fi | ||||||
|  |                     unar -k skip Apple_II_System_Disk_3.2.sea.bin &> /dev/null | ||||||
|                 fi |                 fi | ||||||
|                 if [[ ! -f 'Apple II System Disk 3.2.sea' ]]; then |                 if [[ ! -f 'Apple II System Disk 3.2.sea' ]]; then | ||||||
|                     wget -qO Apple_II_System_Disk_3.2.sea.bin ${binaryURL}external/appleii/Apple_II_System_Disk_3.2.sea.bin |                     wget -qO Apple_II_System_Disk_3.2.sea.bin ${binaryURL}external/appleii/Apple_II_System_Disk_3.2.sea.bin | ||||||
| @@ -539,12 +712,27 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then | |||||||
|      |      | ||||||
|         fi |         fi | ||||||
|  |  | ||||||
|  |         p8CommInstalled= | ||||||
|  |         [[ -f $commDir/ProTERM/PROTERM && -f $commDir/Z.Link/Z.LINK && -f $commDir/ADTPro/ADTPRO && -f $commDir/ADTPro/VSDRIVE ]] && p8CommInstalled=1 | ||||||
|  |         gsosCommInstalled= | ||||||
|  |         [[ -f $commDir/Spectrum/Spectrum && -f $commDir/SAM2/SAM2 && -f $commDir/SAFE2/SAFE2 && -f $commDir/SNAP/SNAP && -f $gsosDir/System/CDevs/TCPIP ]] && gsosCommInstalled=1 | ||||||
|  |         commInstalled= | ||||||
|  |         if [[ $gsosInstalled ]]; then | ||||||
|  |             [[ $gsosCommInstalled && $p8CommInstalled ]] && commInstalled=1 | ||||||
|  |         else | ||||||
|  |             commInstalled=$p8CommInstalled | ||||||
|  |         fi | ||||||
|  |         REPLY= | ||||||
|         if [[ ! $autoAnswerYes ]]; then |         if [[ ! $autoAnswerYes ]]; then | ||||||
|             [[ -f "$gsosDir/System/Start.GS.OS" ]] && gsosInstalled="GS/OS and " || gsosInstalled= |             if [[ ! $commInstalled ]]; then | ||||||
|             echo |                 echo | ||||||
|             echo "Do you want to download communications software for" |                 echo "Do you want to download communications software for" | ||||||
|             echo -n "$gsosInstalled""ProDOS 8? " |                 echo -n "$gsosInstalled""ProDOS 8? " | ||||||
|             read |                 read | ||||||
|  |             else | ||||||
|  |                 echo | ||||||
|  |                 echo "A2SERVER: Communications software is already installed." | ||||||
|  |             fi | ||||||
|         fi |         fi | ||||||
|         if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then |         if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then | ||||||
|      |      | ||||||
| @@ -553,26 +741,43 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then | |||||||
|             mkdir -p $commDir |             mkdir -p $commDir | ||||||
|  |  | ||||||
|             if [[ $gsosInstalled ]]; then |             if [[ $gsosInstalled ]]; then | ||||||
|                 echo -n "Spectrum" |  | ||||||
|  |                 unset safeUrl samUrl snapUrl safeVer samVer snapVer | ||||||
|  |                 if [[ $useExternalURL ]]; then | ||||||
|  |                     html=$(wget -qO- http://speccie.co.uk/speccie/Site/Download_Centre_files/widget1_markup.html) | ||||||
|  |                     safeUrl=$(echo "$html" | grep -i 'safe2.*bxy' | tr '<>' '\n' | grep href | cut -d '=' -f 2 | tr -d '"') | ||||||
|  |                     samUrl=$(echo "$html" | grep -i 'sam2.*bxy' | tr '<>' '\n' | grep href | cut -d '=' -f 2 | tr -d '"') | ||||||
|  |                     snapUrl=$(echo "$html" | grep -i 'snap.*bxy' | tr '<>' '\n' | grep href | cut -d '=' -f 2 | tr -d '"') | ||||||
|  |                     safeVer=$(echo $safeUrl | rev | cut -d '/' -f 1 | cut -d '.' -f 2 | rev | cut -c 5- | sed 's/./.&/g' | cut -c 2-) | ||||||
|  |                     samVer=$(echo $samUrl | rev | cut -d '/' -f 1 | cut -d '.' -f 2 | rev | cut -c 4- | sed 's/./.&/g' | cut -c 2-) | ||||||
|  |                     snapVer=$(echo $snapUrl | rev | cut -d '/' -f 1 | cut -d '.' -f 2 | rev | cut -c 5- | sed 's/./.&/g' | cut -c 2-) | ||||||
|  |                     spectrumVer=$(echo "$html" | grep 'Spectrum.*Gold.2mg' | tr '<>' '\n' | grep '^Spectrum.*2mg$' | cut -d ' ' -f 2) | ||||||
|  |                 fi | ||||||
|  |                  | ||||||
|  |                 echo -n "Spectrum $spectrumVer" | ||||||
|                 # get Spectrum |                 # get Spectrum | ||||||
|                 if [[ -f $spectrumDir/Spectrum ]]; then |                 if [[ -f $commDir/Spectrum/Spectrum ]]; then | ||||||
|                     echo " is already installed." |                     echo " is already installed." | ||||||
|                 else |                 else | ||||||
|                     mkdir -p $spectrumDir |  | ||||||
|                     echo |                     echo | ||||||
|  |                     mkdir -p $commDir/Spectrum | ||||||
|  |                     # remove images that might have been installed by 1.2.5 | ||||||
|  |                     cd $commDir/Spectrum | ||||||
|  |                     rm SPECTRUM.HDV MANUALS.HDV SOUNDS.HDV EXTRAS.HDV &> /dev/null | ||||||
|  |                     # install Spectrum into GS/OS | ||||||
|                     mkdir -p /tmp/netboot/spectrum |                     mkdir -p /tmp/netboot/spectrum | ||||||
|                     cd /tmp/netboot/spectrum |                     cd /tmp/netboot/spectrum | ||||||
|                     # install Spectrum into GS/OS |  | ||||||
|                     if [[ $useExternalURL ]]; then |                     if [[ $useExternalURL ]]; then | ||||||
|                         wget -qO spectrum_gold_2mg.zip http://www.speccie.co.uk/speccie/software/spectrum_gold_2mg.zip |                         wget -qO spectrum_gold_2mg.zip http://www.speccie.co.uk/speccie/software/spectrum_gold_2mg.zip | ||||||
|                         unzip -p spectrum_gold_2mg.zip 2> /dev/null | dd bs=64 skip=1 of=Spectrum.Gold.HDV 2> /dev/null |                         unzip spectrum_gold_2mg.zip Spectrum.Gold.2mg &> /dev/null | ||||||
|                     fi |                     fi | ||||||
|                     if [[ ! -f Spectrum.Gold.2mg ]]; then |                     if [[ ! -f Spectrum.Gold.2mg || $(wc -c < Spectrum.Gold.2mg) -eq 0 ]]; then | ||||||
|                         wget -qO spectrum_gold_2mg.zip ${binaryURL}external/appleii/spectrum_gold_2mg.zip |                         wget -qO spectrum_gold_2mg.zip ${binaryURL}external/appleii/spectrum_gold_2mg.zip | ||||||
|                         unzip -p spectrum_gold_2mg.zip 2> /dev/null | dd bs=64 skip=1 of=Spectrum.Gold.HDV 2> /dev/null |                         unzip spectrum_gold_2mg.zip Spectrum.Gold.2mg &> /dev/null | ||||||
|                     fi |                     fi | ||||||
|                     cppo -s -ad Spectrum.Gold.HDV . &> /dev/null |                     cppo -s -ad Spectrum.Gold.2mg . &> /dev/null | ||||||
|                     userFolder=$(tr [:lower:] [:upper:] <<< $USER) |                     userFolder=$(tr [:lower:] [:upper:] <<< $USER) | ||||||
|  |                      | ||||||
|                     for thisFolder in \ |                     for thisFolder in \ | ||||||
|                       Installer/Extras/CDEvs^System/CDevs \ |                       Installer/Extras/CDEvs^System/CDevs \ | ||||||
|                       Installer/Extras/Tools^System/Tools \ |                       Installer/Extras/Tools^System/Tools \ | ||||||
| @@ -580,10 +785,10 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then | |||||||
|                       Installer/Extras/System.Setup^System/System.Setup \ |                       Installer/Extras/System.Setup^System/System.Setup \ | ||||||
|                       Installer/Help^System/Desk.Accs \ |                       Installer/Help^System/Desk.Accs \ | ||||||
|                       Installer/Spectrum.Sounds^System/Sounds \ |                       Installer/Spectrum.Sounds^System/Sounds \ | ||||||
|                       Spectrum.2.5.4/Add.Ons^USERS/$userFolder/Add.Ons \ |                       Spectrum.*/Add.Ons^USERS/$userFolder/Add.Ons \ | ||||||
|                       Spectrum.2.5.4/Spectrum.Script^USERS/$userFolder/Spectrum.Script \ |                       Spectrum.*/Spectrum.Script^USERS/$userFolder/Spectrum.Script \ | ||||||
|                       Spectrum.2.5.4/Add.Ons^Comm/Spectrum/Add.Ons \ |                       Spectrum.*/Add.Ons^Comm/Spectrum/Add.Ons \ | ||||||
|                       Spectrum.2.5.4/Spectrum.Script^Comm/Spectrum/Spectrum.Script \ |                       Spectrum.*/Spectrum.Script^Comm/Spectrum/Spectrum.Script \ | ||||||
|                       Manuals^Comm/Spectrum/Manuals |                       Manuals^Comm/Spectrum/Manuals | ||||||
|                     do |                     do | ||||||
|                         mkdir -p $gsosDir/"${thisFolder##*^}" |                         mkdir -p $gsosDir/"${thisFolder##*^}" | ||||||
| @@ -591,46 +796,225 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then | |||||||
|                         mkdir -p $gsosDir/"${thisFolder##*^}"/.AppleDouble |                         mkdir -p $gsosDir/"${thisFolder##*^}"/.AppleDouble | ||||||
|                         cp -R Spectrum.Gold/${thisFolder%%^*}/.AppleDouble/* $gsosDir/"${thisFolder##*^}"/.AppleDouble |                         cp -R Spectrum.Gold/${thisFolder%%^*}/.AppleDouble/* $gsosDir/"${thisFolder##*^}"/.AppleDouble | ||||||
|                     done |                     done | ||||||
|                     mv Spectrum.Gold/Installer/SoundPatch Spectrum.Gold/Spectrum.2.5.4/Spectrum $spectrumDir |                     cpAD Spectrum.Gold/Installer/SoundPatch $commDir/Spectrum | ||||||
|                     mkdir -p $spectrumDir/.AppleDouble |                     cpAD Spectrum.Gold/Spectrum.*/Spectrum $commDir/Spectrum | ||||||
|                     mv Spectrum.Gold/Installer/.AppleDouble/SoundPatch Spectrum.Gold/Spectrum.2.5.4/.AppleDouble/Spectrum $spectrumDir/.AppleDouble |  | ||||||
|                     afpsync -v $gsosDir > /dev/null |                     afpsync -v $gsosDir > /dev/null | ||||||
|                 fi |                 fi | ||||||
|             fi |  | ||||||
|  |  | ||||||
|             echo -n "ProTERM and Z-Link" |                 echo -n "Marinetti 3.0b8" | ||||||
|  |                 if [[ -f $gsosDir/System/CDevs/TCPIP ]]; then | ||||||
|  |                     echo " is already installed." | ||||||
|  |                 else | ||||||
|  |                     echo | ||||||
|  |                     mkdir -p /tmp/netboot/marinetti | ||||||
|  |                     cd /tmp/netboot/marinetti | ||||||
|  |  | ||||||
|  |                     # Marinetti 3.0b1 -- had to repackage because installer is GS/OS self-contained app | ||||||
|  |                     wget -qO MarinettiB1.SHK ${binaryURL}appleii/MarinettiB1.SHK | ||||||
|  |                     cppo -ad -s -n MarinettiB1.SHK $gsosDir > /dev/null | ||||||
|  |  | ||||||
|  |                     # TCP/IP update (3.0b8) | ||||||
|  |                     if [[ $useExternalURL ]]; then | ||||||
|  |                         wget -qO Marinetti3.0b8.po http://www.a2retrosystems.com/downloads/Marinetti3.0b8.po | ||||||
|  |                     fi | ||||||
|  |                     if [[ $? != 0 || ! -f Marinetti3.0b8.po || $(wc -c < Marinetti3.0b8.po) != "819200" ]]; then | ||||||
|  |                         wget -qO Marinetti3.0b8.po ${binaryURL}external/appleii/Marinetti3.0b8.po | ||||||
|  |                     fi | ||||||
|  |                     cppo -ad Marinetti3.0b8.po /MARINETTI3.0B8/TCPIP $gsosDir/System/System.Setup > /dev/null | ||||||
|  |                     cppo -ad Marinetti3.0b8.po /MARINETTI3.0B8/CHANGELOG.3.0B8 $commDir/Marinetti > /dev/null | ||||||
|  |  | ||||||
|  |                     # PPP Scripted Link Layer update (1.3d4) | ||||||
|  |                     if [[ $useExternalURL ]]; then | ||||||
|  |                         wget -qO PPPX.1.3d4.SHK http://www.apple2.org/marinetti/PPPX.1.3d4.SHK | ||||||
|  |                     fi | ||||||
|  |                     if [[ $? != 0 || ! -f PPPX.1.3d4.SHK || $(wc -c < PPPX.1.3d4.SHK) != "22068" ]]; then | ||||||
|  |                         wget -qO PPPX.1.3d4.SHK ${binaryURL}external/appleii/PPPX.1.3d4.SHK | ||||||
|  |                     fi | ||||||
|  |                     cppo -ad -s PPPX.1.3d4.SHK . > /dev/null | ||||||
|  |                     cd PPPX.1.3d4 | ||||||
|  |                     cpAD PPP.scripted $gsosDir/System/TCPIP | ||||||
|  |                     cpAD PPP.Script.DOC $commDir/Marinetti/Documentation | ||||||
|  |                     mkdir -p $commDir/Marinetti/PPP.scripted | ||||||
|  |                     cpAD Connect.Script $commDir/Marinetti/PPP.scripted | ||||||
|  |                     cpAD ChangeLog $commDir/Marinetti/PPP.scripted | ||||||
|  |  | ||||||
|  |                     # Uthernet Link Layer | ||||||
|  |                     if [[ $useExternalURL ]]; then | ||||||
|  |                         wget -qO uthernetll.bxy http://www.speccie.co.uk/speccie/software/uthernetll.bxy | ||||||
|  |                     fi | ||||||
|  |                     if [[ $? != 0 || ! -f uthernetll.bxy || $(wc -c < uthernetll.bxy) -eq 0 ]]; then | ||||||
|  |                         wget -qO uthernetll.bxy ${binaryURL}external/appleii/uthernetll.bxy | ||||||
|  |                     fi | ||||||
|  |                     cppo -ad -s -n uthernetll.bxy $gsosDir/System/TCPIP > /dev/null | ||||||
|  |  | ||||||
|  |                     # Uthernet II Link Layer | ||||||
|  |                     if [[ $useExternalURL ]]; then | ||||||
|  |                         wget -qO uthernet2ll.bxy http://www.speccie.co.uk/speccie/software/uthernet2ll.bxy | ||||||
|  |                     fi | ||||||
|  |                     if [[ $? != 0 || ! -f uthernet2ll.bxy || $(wc -c < uthernet2ll.bxy) -eq 0 ]]; then | ||||||
|  |                         wget -qO uthernet2ll.bxy ${binaryURL}external/appleii/uthernet2ll.bxy | ||||||
|  |                     fi | ||||||
|  |                     cppo -ad -s -n uthernet2ll.bxy $gsosDir/System/TCPIP > /dev/null | ||||||
|  |  | ||||||
|  |                     # MacIP Link Layer settings for A2SERVER | ||||||
|  |                     wget -qO- ${binaryURL}macip-prefs.tgz | tar Pxz | ||||||
|  |  | ||||||
|  |                     afpsync -v $gsosDir > /dev/null | ||||||
|  |                 fi | ||||||
|  |  | ||||||
|  |                 echo -n "SAFE2 $safeVer" | ||||||
|  |                 if [[ -f $commDir/SAFE2/SAFE2 ]]; then | ||||||
|  |                     echo " is already installed." | ||||||
|  |                 else | ||||||
|  |                     echo | ||||||
|  |                     mkdir -p $commDir/SAFE2 | ||||||
|  |                     mkdir -p /tmp/netboot/safe2 | ||||||
|  |                     cd /tmp/netboot/safe2 | ||||||
|  |                     if [[ $useExternalURL ]]; then | ||||||
|  |                         [[ ! $safeUrl ]] && safeUrl="http://www.speccie.co.uk/speccie/software/safe229.bxy" | ||||||
|  |                         wget -qO safe2.bxy "$safeUrl" | ||||||
|  |                         cppo -s -ad safe2.bxy . &> /dev/null | ||||||
|  |                     fi | ||||||
|  |                     if [[ ! -f SAFE2.Archive/Safe2 ]]; then | ||||||
|  |                         wget -qO safe2.bxy ${binaryURL}external/appleii/safe2.bxy | ||||||
|  |                         cppo -s -ad safe2.bxy . &> /dev/null | ||||||
|  |                     fi | ||||||
|  |                     cd SAFE2.Archive | ||||||
|  |                     cpAD Safe2 $commDir/SAFE2 | ||||||
|  |                     cpAD The.Manual $commDir/SAFE2 | ||||||
|  |                     cpAD Read.Me.First $commDir/SAFE2 | ||||||
|  |                     cpAD Version.History $commDir/SAFE2 | ||||||
|  |                     cpAD Fonts/SAFE.8 $gsosDir/System/Fonts | ||||||
|  |                     cpAD Fonts/Shaston.16 $gsosDir/System/Fonts | ||||||
|  |                     cpAD TimeZone/TimeZone $gsosDir/System/CDEvs | ||||||
|  |                     cpAD TimeZone/Tool056 $gsosDir/System/Tools | ||||||
|  |                     rm -r $gsosDir/System/Desk.Accs/Help.Files/SAFE2 2> /dev/null | ||||||
|  |                     mv Help/Help.Files/SAFE2 $gsosDir/System/Desk.Accs/Help.Files | ||||||
|  |                     wget -qO- ${binaryURL}safe2-setup.tgz | tar Pzx | ||||||
|  |  | ||||||
|  |                     afpsync -v $gsosDir > /dev/null | ||||||
|  |                 fi | ||||||
|  |  | ||||||
|  |                 echo -n "SAM2 $samVer" | ||||||
|  |                 if [[ -f $commDir/SAM2/SAM2 ]]; then | ||||||
|  |                     echo " is already installed." | ||||||
|  |                 else | ||||||
|  |                     echo | ||||||
|  |                     mkdir -p $commDir/SAM2 | ||||||
|  |                     mkdir -p $commDir/SAM2/SAM2.Data | ||||||
|  |                     mkdir -p /tmp/netboot/sam2 | ||||||
|  |                     cd /tmp/netboot/sam2 | ||||||
|  |                     if [[ $useExternalURL ]]; then | ||||||
|  |                         [[ ! $samUrl ]] && samUrl="http://www.speccie.co.uk/speccie/software/sam205.bxy" | ||||||
|  |                         wget -qO sam2.bxy "$samUrl" | ||||||
|  |                         cppo -s -ad sam2.bxy . &> /dev/null | ||||||
|  |                     fi | ||||||
|  |                     if [[ ! -f SAM2.Archive/SAM2/SAM2 ]]; then | ||||||
|  |                         wget -qO sam2.bxy ${binaryURL}external/appleii/sam2.bxy | ||||||
|  |                         cppo -s -ad sam2.bxy . &> /dev/null | ||||||
|  |                     fi | ||||||
|  |                     cd SAM2.Archive | ||||||
|  |                     cpAD SAM2/SAM2 $commDir/SAM2 | ||||||
|  |                     cpAD SAM2/SAM2.Data/Taglines $commDir/SAM2/SAM2.Data | ||||||
|  |                     cpAD Sounds/SP.Snds.Aux $gsosDir/System/Sounds | ||||||
|  |                     cpAD Fonts/SAM.8 $gsosDir/System/Fonts | ||||||
|  |                     cpAD Fonts/SAM.10 $gsosDir/System/Fonts | ||||||
|  |                     cpAD The.Manual $commDir/SAM2 | ||||||
|  |                     cpAD Read.Me.First $commDir/SAM2 | ||||||
|  |                     cpAD Version.History $commDir/SAM2 | ||||||
|  |                     rm -r $gsosDir/System/Desk.Accs/Help.Files/SAM2 2> /dev/null | ||||||
|  |                     mv Help/Help.Files/SAM2 $gsosDir/System/Desk.Accs/Help.Files | ||||||
|  |                     # cpAD Fonts/SIS.3.10 $gsosDir/System/Fonts | ||||||
|  |                     # cpAD Fonts/SIS.4.10 $gsosDir/System/Fonts | ||||||
|  |                     # cpAD Tools/HTMLTool/TOOL130 $gsosDir/System/Tools | ||||||
|  |                     # cpAD Tools/Hierarchic/Hierarchic $gsosDir/System/CDEvs | ||||||
|  |                     # cpAD Fonts/Shaston.16 $gsosDir/System/Fonts | ||||||
|  |  | ||||||
|  |                     afpsync -v $gsosDir > /dev/null | ||||||
|  |                 fi | ||||||
|  |  | ||||||
|  |                 echo -n "SNAP $snapVer" | ||||||
|  |                 if [[ -f $commDir/SNAP/SNAP ]]; then | ||||||
|  |                     echo " is already installed." | ||||||
|  |                 else | ||||||
|  |                     echo | ||||||
|  |                     mkdir -p $commDir/SNAP | ||||||
|  |                     mkdir -p /tmp/netboot/snap | ||||||
|  |                     cd /tmp/netboot/snap | ||||||
|  |                     if [[ $useExternalURL ]]; then | ||||||
|  |                         [[ ! $snapUrl ]] && snapUrl="http://www.speccie.co.uk/speccie/software/snap118.bxy" | ||||||
|  |                         wget -qO snap.bxy "$snapUrl" | ||||||
|  |                         cppo -s -ad snap.bxy . &> /dev/null | ||||||
|  |                     fi | ||||||
|  |                     if [[ ! -f SNAP.Archive/SNAP ]]; then | ||||||
|  |                         wget -qO snap.bxy ${binaryURL}external/appleii/snap.bxy | ||||||
|  |                         cppo -s -ad snap.bxy . &> /dev/null | ||||||
|  |                     fi | ||||||
|  |                     cd SNAP.Archive | ||||||
|  |                     cpAD SNAP $commDir/SNAP | ||||||
|  |                     cpAD Fonts/SNAP.8 $gsosDir/System/Fonts | ||||||
|  |                     cpAD Fonts/SNAP.10 $gsosDir/System/Fonts | ||||||
|  |                     cpAD The.Manual $commDir/SNAP | ||||||
|  |                     cpAD Read.Me.First $commDir/SNAP | ||||||
|  |                     cpAD Change.List $commDir/SNAP | ||||||
|  |                     cpAD Quick.Start $commDir/SNAP | ||||||
|  |                     rm -r $gsosDir/System/Desk.Accs/Help.Files/SNAP 2> /dev/null | ||||||
|  |                     mv Help/Help.Files/SNAP $gsosDir/System/Desk.Accs/Help.Files | ||||||
|  |                     wget -qO- ${binaryURL}snap-setup.tgz | tar Pzx | ||||||
|  |                     # cpAD Fonts/SIS.3.10 $gsosDir/System/Fonts | ||||||
|  |                     # cpAD Fonts/SIS.4.10 $gsosDir/System/Fonts | ||||||
|  |                     # cpAD Tools/HTMLTool/TOOL130 $gsosDir/System/Tools | ||||||
|  |                     # cpAD Tools/Hierarchic/Hierarchic $gsosDir/System/CDEvs | ||||||
|  |                     # cpAD Fonts/Shaston.16 $gsosDir/System/Fonts | ||||||
|  |  | ||||||
|  |                     afpsync -v $gsosDir > /dev/null | ||||||
|  |                 fi | ||||||
|  |              fi | ||||||
|  |  | ||||||
|  |             echo -n "ProTERM 3.1" | ||||||
|             # get A2CLOUD disk and copy from there |             # get A2CLOUD disk and copy from there | ||||||
|             if [[ -f $protermDir/PROTERM ]]; then |             if [[ -f $commDir/ProTERM/PROTERM ]]; then | ||||||
|                 echo " are already installed." |                 echo " is already installed." | ||||||
|             else |             else | ||||||
|                 mkdir -p $protermDir |  | ||||||
|                 mkdir -p $protermDir/.AppleDouble |  | ||||||
|                 mkdir -p $zlinkDir |  | ||||||
|                 mkdir -p $zlinkDir/.AppleDouble |  | ||||||
|                 echo |                 echo | ||||||
|  |                 mkdir -p $commDir/ProTERM | ||||||
|  |                 mkdir -p $commDir/ProTERM/.AppleDouble | ||||||
|                 cd /tmp/netboot |                 cd /tmp/netboot | ||||||
|                 wget -qO A2CLOUD.HDV "${binaryURL}A2CLOUD.HDV" |                 wget -qO A2CLOUD.HDV "${binaryURL}appleii/A2CLOUD.HDV" | ||||||
|                 cppo -ad A2CLOUD.HDV . &> /dev/null |                 cppo -s -ad A2CLOUD.HDV . &> /dev/null | ||||||
|                 cd A2CLOUD |                 cd A2CLOUD | ||||||
|                 mv *PT3* *PROTERM* $protermDir |                 mv *PT3* *PROTERM* $commDir/ProTERM | ||||||
|                 mv Z.LINK $zlinkDir |  | ||||||
|                 cd .AppleDouble |                 cd .AppleDouble | ||||||
|                 mv *PT3* *PROTERM* $protermDir/.AppleDouble |                 mv *PT3* *PROTERM* $commDir/ProTERM/.AppleDouble | ||||||
|                 mv Z.LINK $zlinkDir/.AppleDouble |  | ||||||
|                 afpsync -v $gsosDir > /dev/null |                 afpsync -v $gsosDir > /dev/null | ||||||
|             fi             |             fi             | ||||||
|  |  | ||||||
|             echo -n "ADTPro and VSDRIVE" |             echo -n "Z-Link 12-15-91" | ||||||
|             if [[ -f $adtproDir/ADTPRO ]]; then |             # get A2CLOUD disk and copy from there | ||||||
|                 echo " are already installed." |             if [[ -f $commDir/Z.Link/Z.LINK ]]; then | ||||||
|  |                 echo " is already installed." | ||||||
|             else |             else | ||||||
|                 mkdir -p $adtproDir |                 echo | ||||||
|                 mkdir -p $adtproDir/.AppleDouble |                 mkdir -p $commDir/Z.Link | ||||||
|  |                 mkdir -p $commDir/Z.Link/.AppleDouble | ||||||
|  |                 cd /tmp/netboot/A2CLOUD | ||||||
|  |                 mv Z.LINK $commDir/Z.Link | ||||||
|  |                 cd .AppleDouble | ||||||
|  |                 mv Z.LINK $commDir/Z.Link/.AppleDouble | ||||||
|  |                 afpsync -v $gsosDir > /dev/null | ||||||
|  |             fi             | ||||||
|  |  | ||||||
|  |             echo -n "ADTPro 2.0.1" | ||||||
|  |             if [[ -f $commDir/ADTPro/ADTPRO ]]; then | ||||||
|  |                 echo " is already installed." | ||||||
|  |             else | ||||||
|  |                 mkdir -p $commDir/ADTPro | ||||||
|  |                 mkdir -p $commDir/ADTPro/.AppleDouble | ||||||
|                 echo |                 echo | ||||||
|                 cd /tmp/netboot/A2CLOUD |                 cd /tmp/netboot/A2CLOUD | ||||||
|                 mv *ADTPRO* *VEDRIVE* *VSDRIVE* $adtproDir |                 mv *ADTPRO* *VEDRIVE* *VSDRIVE* $commDir/ADTPro | ||||||
|                 cd .AppleDouble |                 cd .AppleDouble | ||||||
|                 mv *ADTPRO* *VEDRIVE* *VSDRIVE* $adtproDir/.AppleDouble |                 mv *ADTPRO* *VEDRIVE* *VSDRIVE* $commDir/ADTPro/.AppleDouble | ||||||
|                 afpsync -v $gsosDir > /dev/null |                 afpsync -v $gsosDir > /dev/null | ||||||
|             fi             |             fi             | ||||||
|  |  | ||||||
| @@ -651,31 +1035,30 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then | |||||||
|      |      | ||||||
|     fi |     fi | ||||||
|  |  | ||||||
|     if [[ ! $autoAnswerYes ]]; then |     REPLY= | ||||||
|         echo |     if [[ -d $gsosDir/SYSTEM/SYSTEM.SETUP ]]; then | ||||||
|         echo "Do you want to download the patch required for using" |         if [[ ! $autoAnswerYes ]]; then | ||||||
|         echo -n "a Farallon LocalTalk-to-Ethernet bridge with GS/OS? " |             if [[ ! -f $gsosDir/SYSTEM/SYSTEM.SETUP/ATALKIRQ ]]; then | ||||||
|         read |                 echo | ||||||
|     fi |                 echo "Do you want to download the patch required for using" | ||||||
|     if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then |                 echo -n "a Farallon LocalTalk-to-Ethernet bridge with GS/OS? " | ||||||
|         # Farallon bridge patch for GS/OS courtesy of Geoff Body |                 read | ||||||
|         echo "A2SERVER: Downloading Farallon bridge patch..." |             else | ||||||
|         wget -O /tmp/FARALLON.PO "${binaryURL}FARALLON.B1.PO" &> /dev/null |                 echo | ||||||
|         if [[ -d $gsosDir/SYSTEM/SYSTEM.SETUP ]]; then |                 echo "A2SERVER: The Farallon bridge patch has already been installed." | ||||||
|  |             fi | ||||||
|  |         fi | ||||||
|  |         if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then | ||||||
|  |             # Farallon bridge patch for GS/OS courtesy of Geoff Body | ||||||
|  |             echo "A2SERVER: Downloading Farallon bridge patch..." | ||||||
|  |             wget -qO /tmp/FARALLON.PO "${binaryURL}appleii/FARALLON.B1.PO" &> /dev/null | ||||||
|             cppo -s -ad /tmp/FARALLON.PO /ATALKPATCH/ATALKIRQ $gsosDir/SYSTEM/SYSTEM.SETUP &> /dev/null |             cppo -s -ad /tmp/FARALLON.PO /ATALKPATCH/ATALKIRQ $gsosDir/SYSTEM/SYSTEM.SETUP &> /dev/null | ||||||
|             echo |             echo | ||||||
|             echo "A2SERVER: The Farallon bridge patch is installed." |             echo "A2SERVER: The Farallon bridge patch is installed." | ||||||
|         else |  | ||||||
|             cppo -s -ad /tmp/FARALLON.PO /ATALKPATCH/ATALKIRQ $gsosDir &> /dev/null |  | ||||||
|             echo |             echo | ||||||
|             echo "On your Apple IIgs, copy the file ATALKIRQ in /A2SHARED to the" |             echo "Note: Farallon bridges can only be used in GS/OS (with this patch)" | ||||||
|             echo "SYSTEM.SETUP folder of the SYSTEM folder of your GSOS startup disk," |             echo "and Apple IIe computers. Apple IIgs computers which network boot" | ||||||
|             echo "or, if you can't, download the patch from the A2SERVER web site." |             echo "directly into ProDOS 8 will freeze after a few minutes." | ||||||
|         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 | ||||||
|   | |||||||
| @@ -14,7 +14,7 @@ password="your password" | |||||||
| [[ $isRaspberryPw ]] && password="'raspberry'" | [[ $isRaspberryPw ]] && password="'raspberry'" | ||||||
|  |  | ||||||
| isDebian= | isDebian= | ||||||
| [[ ( -f /etc/debian_version ) && ( $(cut -c 1-2 < /etc/debian_version) == "7." ) && ( $(uname -m) == "i686" ) ]] && isDebian=1 | b_release -a 2> /dev/null | grep -q 'Distributor ID:.Debian' && [[ ( -f /etc/debian_version ) && ( $(cut -d . -f 1 < /etc/debian_version) -ge "7" ) ]] && isDebian=1 | ||||||
|  |  | ||||||
| if [[ $isDebian ]]; then | if [[ $isDebian ]]; then | ||||||
|     if { lspci 2> /dev/null | grep -q VirtualBox; }; then |     if { lspci 2> /dev/null | grep -q VirtualBox; }; then | ||||||
|   | |||||||
							
								
								
									
										180
									
								
								scripts/clock.patch.py
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										180
									
								
								scripts/clock.patch.py
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,180 @@ | |||||||
|  | #!/usr/bin/env python | ||||||
|  | '''CLOCK.PATCH by Greg Branche implemented in Python 2/3 for A2SERVER | ||||||
|  |  | ||||||
|  | This is a line-for-line conversion of an edited version of CLOCK.PATCH | ||||||
|  | from the System Tools 2 disk in GS/OS 6.0.1. It's not good Python, | ||||||
|  | but I thought it would be an interesting exercise. In general | ||||||
|  | I have tried replicate each line as closely to BASIC as possible. | ||||||
|  |  | ||||||
|  | Because BASIC substrings are 1-based and python's are 0-based, various | ||||||
|  | indexes are minus one of their BASIC equivalents. | ||||||
|  |  | ||||||
|  | The one change is that you can optionally pass the day and date by | ||||||
|  | command line argument (e.g "Wed 3/13/15"). I also improved error | ||||||
|  | checking. These are in the BASIC lines that don't end in 0. | ||||||
|  |  | ||||||
|  | Rather than modifying PRODOS, this outputs a string of comma-separated | ||||||
|  | year values for a calling script (the a2server-setup installer), | ||||||
|  | followed by a space and a dd-Mmm-yy date string. | ||||||
|  | ''' | ||||||
|  |  | ||||||
|  | # imports for python 3 code compatibility | ||||||
|  | from __future__ import print_function | ||||||
|  | from __future__ import unicode_literals | ||||||
|  | from __future__ import absolute_import | ||||||
|  | from __future__ import division | ||||||
|  |  | ||||||
|  | # other imports | ||||||
|  | import sys | ||||||
|  | import datetime | ||||||
|  |  | ||||||
|  | # substitute raw_input for input in Python2 | ||||||
|  | try: input = raw_input | ||||||
|  | except NameError: pass | ||||||
|  |  | ||||||
|  | dow_str = None | ||||||
|  | day = None | ||||||
|  | if len(sys.argv) > 2: | ||||||
|  |     dow_str = sys.argv[1] # day of week passed on command line | ||||||
|  |     day     = sys.argv[2] # date passed on command line | ||||||
|  |  | ||||||
|  |                                                 # 60000  REM  # of days in each month | ||||||
|  | data = [31,28,31,30,31,30,31,31,30,31,30]       # 60010  DATA  31,28,31,30,31,30,31,31,30,31,30 | ||||||
|  |                                                 # 60020  REM  Names of days of week | ||||||
|  | data += [                                       # 60030  DATA  SUN,MON,TUE,WED,THU,FRI,SAT | ||||||
|  |   "SUN","MON","TUE","WED","THU","FRI","SAT"] | ||||||
|  | data = iter(data) | ||||||
|  |                                                 # 110  REM  cu() = cumulative # of days in year | ||||||
|  | cu = [0] * 13                                   # 120  DIM CU(12) | ||||||
|  |                                                 # 130  REM  fill array with # of days in year | ||||||
|  | cu[1] = 0                                       # 140 CU(1) = 0: REM  January | ||||||
|  | for i in range(2,13):                           # 150  FOR I = 2 TO 12 | ||||||
|  |     x = next(data)                              # 160  READ X | ||||||
|  |     cu[i] = cu[i-1] + x                         # 170 CU(I) = CU(I - 1) + X | ||||||
|  |                                                 # 180  NEXT I | ||||||
|  |  | ||||||
|  |                                                 # 200  REM  DN$() = Names for days of week | ||||||
|  | dn = [""] * 8                                   # 210  DIM DN$(7) | ||||||
|  |                                                 # 220  REM  fill array with names of days of week | ||||||
|  | for i in range(1,8):                            # 230  FOR I = 1 TO 7 | ||||||
|  |     dn[i] = next(data)                          # 240  READ DN$(I) | ||||||
|  |                                                 # 250  NEXT I | ||||||
|  |  | ||||||
|  |                                                 # 270  REM  yt() is the year table values | ||||||
|  | yt = [0] * 8                                    # 280  DIM YT(7) | ||||||
|  |  | ||||||
|  | def mod7(x):                                    # 340  DEF  FN MOD7(X) =  INT (((X / 7) -  INT (X / 7)) * 7 + .5) | ||||||
|  |     return int(((x / 7) -  int(x / 7)) * 7 + .5) | ||||||
|  |  | ||||||
|  | def find_slash_pos(day):                        # 799  REM  Finds position of / within date string | ||||||
|  |     x = -1                                      # 800 X = 0: REM On exit, contains position of /, or 0 if none found | ||||||
|  |     for i in range(0,3):                        # 810  FOR I = 1 TO 3 | ||||||
|  |         if day[i:i+1] == "/": x = i; break      # 820  IF  MID$ (DAY$,I,1) = "/" THEN X = I:I = 3 | ||||||
|  |                                                 # 830  NEXT I | ||||||
|  |     return x                                    # 840  RETURN  | ||||||
|  |  | ||||||
|  | while True:                                     # 999  REM  get the user's input and convert | ||||||
|  |     if not day: | ||||||
|  |         print(                                  # 1010  PRINT "Please enter today's date (mm/dd/yy)" | ||||||
|  |           "Please enter today's date (mm/dd/yy)") | ||||||
|  |         day = input("-> ")                      # 1020  INPUT "-> ";DAY$ | ||||||
|  |     x = find_slash_pos(day)                     # 1030  GOSUB 800: REM  find slash separator | ||||||
|  |     input_ok = False | ||||||
|  |     while not input_ok: | ||||||
|  |         if not (x != -1):                       # 1040  IF X <  > 0 THEN 1080 | ||||||
|  |             print(                              # 1050  PRINT "Invalid date entered.  Please try again."; CHR$ (7) | ||||||
|  |               "Invalid date entered.  Please try again.\x07") | ||||||
|  |             break                               # 1060  GOTO 1010 | ||||||
|  |                                                 # 1070  REM  Convert month value to numeric variable | ||||||
|  |         mo = int(day[0:0+x])                    # 1080 MO =  VAL ( MID$ (DAY$,1,X - 1)) | ||||||
|  |         day = day[x+1:]                         # 1090 DAY$ =  MID$ (DAY$,X + 1) | ||||||
|  |         if mo < 1 or mo > 12: x = -1; continue  # 1100  IF MO < 1 OR MO > 12 THEN 1050: REM Range check the month value | ||||||
|  |         x = find_slash_pos(day)                 # 1110  GOSUB 800: REM Parse out the current day | ||||||
|  |         if x == -1: continue                    # 1120  IF X = 0 THEN 1050 | ||||||
|  |                                                 # 1130  REM  Convert day string into numeric value | ||||||
|  |         da = int(day[0:0+x])                    # 1140 DA =  VAL ( MID$ (DAY$,1,X - 1)) | ||||||
|  |         day = day[x+1:]                         # 1150 DAY$ =  MID$ (DAY$,X + 1) | ||||||
|  |         if da < 1 or da > 31: x = -1; continue  # 1160  IF DA < 1 OR DA > 31 THEN 1050: REM Range check the day value | ||||||
|  |         if mo == 2 and da > 29:                 # 1161  IF MO = 2 AND DA > 29 THEN 1050 | ||||||
|  |             x = -1; continue | ||||||
|  |         if (mo == 4 or                          # 1162  IF (MO = 4 OR MO = 6 OR MO = 9 OR MO = 11) AND DA > 30 THEN 1050 | ||||||
|  |             mo == 6 or | ||||||
|  |             mo == 9 or | ||||||
|  |             mo == 11) and da > 30: x = -1; continue | ||||||
|  |                                                 # 1170  REM  Convert year string into numeric value | ||||||
|  |         yr = int(day)                           # 1180 YR =  VAL (DAY$) | ||||||
|  |         if yr < 0 or yr > 99: x = -1; continue  # 1190  IF YR < 0 OR YR > 99 THEN 1050: REM Only allow 0-99 | ||||||
|  |         if yr > 39: yr = yr + 1900              # 1200  IF YR > 39 THEN YR = YR + 1900: REM 40-99 must be 1940-1999 | ||||||
|  |         if yr < 40: yr = yr + 2000              # 1210  IF YR < 40 THEN YR = YR + 2000: REM 0-39 must be 2000-2039 | ||||||
|  |         if ((yr / 4) != int(yr / 4) and         # 1211  IF ((YR / 4) <  >  INT(YR / 4)) AND MO = 2 AND DA > 28 THEN 1050 | ||||||
|  |             mo == 2 and | ||||||
|  |             da > 28): x = -1; continue | ||||||
|  |         input_ok = True | ||||||
|  |     if x != -1: break         | ||||||
|  |     else: dow_str = ""; day = "" | ||||||
|  |  | ||||||
|  | while True: | ||||||
|  |     if not dow_str: | ||||||
|  |         print( | ||||||
|  |           "Please enter the day of the week")   # 1230  PRINT "Please enter the day of the week" | ||||||
|  |         dow_str = input("(e.g. Wed) -> ")       # 1240  INPUT "(e.g. Wed) -> ";DOW$ | ||||||
|  |     input_ok = False | ||||||
|  |     while not input_ok: | ||||||
|  |         if not (len(dow_str) >= 3):             # 1250  IF  LEN (DOW$) >  = 3 THEN 1270: REM Must be at least 3 characters | ||||||
|  |             print(                              # 1260  PRINT "Invalid day of week.  Please try again."; CHR$ (7): GOTO 1230 | ||||||
|  |                 "Invalid day of week.  Please try again.\x07") | ||||||
|  |             break | ||||||
|  |         if len(dow_str) > 3:                    # 1270  IF  LEN (DOW$) > 3 THEN DOW$ =  LEFT$ (DOW$,3) | ||||||
|  |             dow_str = dow_str[0:0+3] | ||||||
|  |                                                 # 1280  REM  Shift any lower case letters to upper case | ||||||
|  |         b = ""                                  # 1290 B$ = "" | ||||||
|  |         for i in range(0,3):                    # 1300  FOR I = 1 TO 3 | ||||||
|  |             a = dow_str[i:i+1]                  # 1310 A$ =  MID$ (DOW$,I,1) | ||||||
|  |             if (                                # 1320  IF  ASC (A$) >  =  ASC ("a") AND  ASC (A$) <  =  ASC ("z") THEN A$ =  CHR$ ( ASC (A$) - ( ASC ("a") -  ASC ("A"))) | ||||||
|  |               ord(a) >= ord("a") and ord(a) <= ord("z")): a = chr(ord(a) - (ord("a") -  ord("A"))) | ||||||
|  |             b = b + a                           # 1330 B$ = B$ + A$ | ||||||
|  |                                                 # 1340  NEXT I | ||||||
|  |         dow_str = b                             # 1350 DOW$ = B$ | ||||||
|  |                                                 # 1360  REM  Now convert day-of-week string to numeric value | ||||||
|  |         dow_num = 0                             # 1370 DOW = 0 | ||||||
|  |         for i in range (1,8):                   # 1380  FOR I = 1 TO 7 | ||||||
|  |             if dow_str == dn[i]:                # 1390  IF DOW$ = DN$(I) THEN DOW = I:I = 7 | ||||||
|  |                 dow_num = i; i = 7 | ||||||
|  |                                                 # 1400  NEXT I | ||||||
|  |         if dow_num == 0: dow_str = ""; continue # 1410  IF DOW = 0 THEN 1260 | ||||||
|  |         input_ok = True | ||||||
|  |     if len(dow_str) >= 3: break | ||||||
|  |     else: dow_str = ""; day = "" | ||||||
|  |                                                 # 1430  REM  Calculate the number of days so far this year | ||||||
|  | dys = da + cu[mo]                               # 1440 DYS = DA + CU(MO) | ||||||
|  | oyr = yr | ||||||
|  |                                                 # 1450  REM  Must account for extra day in leap year | ||||||
|  | if ((yr / 4) == int(yr / 4)) and (mo > 2):      # 1460  IF (YR / 4) =  INT (YR / 4) AND MO > 2 THEN DYS = DYS + 1 | ||||||
|  |     dys = dys + 1 | ||||||
|  |  | ||||||
|  |                                                 # 1480  REM  Now calculate the index to use to fill in the table | ||||||
|  | idx = dow_num - mod7(dys) + 1                   # 1490 IDX = DOW -  FN MOD7(DYS) + 1 | ||||||
|  | idx = abs(idx - 10)                             # 1500 IDX =  ABS (IDX - 10) | ||||||
|  | if idx > 7: idx = idx - 7                       # 1510  IF IDX > 7 THEN IDX = IDX - 7 | ||||||
|  |  | ||||||
|  |                                                 # 1530  REM  Now we can fill in the year table | ||||||
|  | for i in range(1,8):                            # 1540  FOR I = 1 TO 7 | ||||||
|  |     if '_i' in vars() and i < (_i + 1): continue    # python: simulate change of i within loop | ||||||
|  |     x = yr - 1900                               # 1550 X = YR - 1900 | ||||||
|  |     if x >= 100: x = x - 100                    # 1560  IF X >  = 100 THEN X = X - 100 | ||||||
|  |     yt[idx] = x                                 # 1570 YT(IDX) = X: REM  store the year into table | ||||||
|  |     idx = idx - 1                               # 1580 IDX = IDX - 1 | ||||||
|  |     if idx < 1: idx = 7                         # 1590  IF IDX < 1 THEN IDX = 7 | ||||||
|  |     if not ((yr / 4) != int(yr / 4)):           # 1600  IF (YR / 4) <  >  INT (YR / 4) THEN 1660: REM  not a leap year | ||||||
|  |         i = i + 1; _i = i                       # 1610 I = I + 1: REM  update index | ||||||
|  |         if i > 7: continue                      # 1620  IF I > 7 THEN 1670: REM  if entire array done, exit | ||||||
|  |         yt[idx] = x                             # 1630 YT(IDX) = X: REM  duplicate entry for leap year | ||||||
|  |         idx = idx - 1                           # 1640 IDX = IDX - 1 | ||||||
|  |         if idx < 1: idx = 7                     # 1650  IF IDX < 1 THEN IDX = 7 | ||||||
|  |     yr = yr + 1                                 # 1660 YR = YR + 1 | ||||||
|  |                                                 # 1670  NEXT I | ||||||
|  |  | ||||||
|  | print(",".join([str(x) for x in yt[1:]]) + " " + | ||||||
|  |       str(da).encode("L1").decode("L1").zfill(2) + "-" + | ||||||
|  |       datetime.date(1900, mo, 1).strftime('%b') + "-" + | ||||||
|  |       str(oyr).encode("L1").decode("L1")[2:]) | ||||||
| @@ -2,17 +2,17 @@ | |||||||
| # vim: set tabstop=4 shiftwidth=4 expandtab filetype=sh: | # vim: set tabstop=4 shiftwidth=4 expandtab filetype=sh: | ||||||
|  |  | ||||||
| alias a2server-help="more /usr/local/etc/a2server-help.txt" | alias a2server-help="more /usr/local/etc/a2server-help.txt" | ||||||
| alias a2server-setup="wget -q -O /tmp/a2server-setup ${A2SERVER_SCRIPT_URL}setup/index.txt || { echo \"Can't download A2SERVER setup scripts. Do you has internet?\"; false; } && source /tmp/a2server-setup" | alias a2server-setup='wget -q -O /tmp/a2server-setup ${A2SERVER_SCRIPT_URL:-https://raw.githubusercontent.com/RasppleII/a2server/current/}setup/index.txt || { echo "Can'"'"'t download A2SERVER setup scripts. Do you has internet?"; false; } && source /tmp/a2server-setup' | ||||||
|  |  | ||||||
| alias a2server-version="cat /usr/local/etc/A2SERVER-version" | alias a2server-version="cat /usr/local/etc/A2SERVER-version" | ||||||
| alias a2server-update="wget -q -O /tmp/a2server-update ${A2SERVER_SCRIPT_URL}update/index.txt || { echo \"Can't download A2SERVER setup scripts. Do you has internet?\"; false; } && source /tmp/a2server-update" | alias a2server-update='wget -q -O /tmp/a2server-update ${A2SERVER_SCRIPT_URL:-https://raw.githubusercontent.com/RasppleII/a2server/current/}update/index.txt || { echo "Can'"'"'t download A2SERVER setup scripts. Do you has internet?"; false; } && source /tmp/a2server-update' | ||||||
|  |  | ||||||
| alias system-shutdown='sudo shutdown -h now' | alias system-shutdown='sudo shutdown -h now' | ||||||
| alias system-restart='sudo shutdown -r now' | alias system-restart='sudo shutdown -r now' | ||||||
|  |  | ||||||
|  |  | ||||||
| alias raspi-config='[[ -f /usr/bin/raspi-config ]] && sudo /usr/bin/raspi-config || echo "raspi-config not found. Are you using a Raspberry Pi with Raspbian?"' | alias raspi-config='[[ -f /usr/bin/raspi-config ]] && sudo /usr/bin/raspi-config || echo "raspi-config not found. Are you using a Raspberry Pi with Raspbian?"' | ||||||
| alias raspbian-update='wget -qO /tmp/raspbian-update ${A2SERVER_SCRIPT_URL}scripts/raspbian-update.txt; source /tmp/raspbian-update' | alias raspbian-update='wget -qO /tmp/raspbian-update ${A2SERVER_SCRIPT_URL:-https://raw.githubusercontent.com/RasppleII/a2server/current/}scripts/raspbian-update.txt || { echo "Can'"'"'t download A2SERVER setup scripts. Do you has internet?"; false; } && source /tmp/raspbian-update' | ||||||
| alias rasppleii-update='raspbian-update a2cloud a2server' | alias rasppleii-update='raspbian-update a2cloud a2server' | ||||||
|  |  | ||||||
| alias welcome-message-edit='sudo nano /etc/motd' | alias welcome-message-edit='sudo nano /etc/motd' | ||||||
| @@ -25,7 +25,7 @@ alias ifreset='sudo rm /etc/udev/rules.d/70-persistent-net.rules; echo Interface | |||||||
|  |  | ||||||
| alias netatalk-stop="sudo /etc/init.d/netatalk stop; bonjour-off" | alias netatalk-stop="sudo /etc/init.d/netatalk stop; bonjour-off" | ||||||
| alias netatalk-start="sudo /etc/init.d/netatalk start; bonjour-on; grep -q 'ATALKD_RUN=yes' /etc/default/netatalk" | alias netatalk-start="sudo /etc/init.d/netatalk start; bonjour-on; grep -q 'ATALKD_RUN=yes' /etc/default/netatalk" | ||||||
| alias netatalk-restart="sudo /etc/init.d/netatalk restart; bonjour-on;  grep -q 'ATALKD_RUN=yes' /etc/default/netatalk" | alias netatalk-restart="sudo /etc/init.d/netatalk restart; bonjour-on; grep -q 'ATALKD_RUN=yes' /etc/default/netatalk" | ||||||
| alias netatalk-off='sudo /etc/init.d/netatalk stop; bonjour-off; sudo update-rc.d -f netatalk remove &> /dev/null' | alias netatalk-off='sudo /etc/init.d/netatalk stop; bonjour-off; sudo update-rc.d -f netatalk remove &> /dev/null' | ||||||
| alias netatalk-on='sudo update-rc.d netatalk defaults &> /dev/null; bonjour-on; sudo /etc/init.d/netatalk restart' | alias netatalk-on='sudo update-rc.d netatalk defaults &> /dev/null; bonjour-on; sudo /etc/init.d/netatalk restart' | ||||||
|  |  | ||||||
| @@ -33,8 +33,8 @@ alias bonjour-off="sudo mv /etc/avahi/services/afpd.service /etc/avahi/services/ | |||||||
| alias bonjour-on="sudo mv /etc/avahi/services/afpd.service_disabled /etc/avahi/services/afpd.service &> /dev/null" | alias bonjour-on="sudo mv /etc/avahi/services/afpd.service_disabled /etc/avahi/services/afpd.service &> /dev/null" | ||||||
|  |  | ||||||
|  |  | ||||||
| alias netatalk-router-on='sudo sed -i '"'"'s/^eth0.*$/eth0 -router -phase 2 -net 1 -zone "A2SERVER"/'"'"' /usr/local/etc/netatalk/atalkd.conf; sudo sed -i '"'"'s/^wlan0.*$/wlan0 -router -phase 2 -net 1 -zone "A2SERVER"/'"'"' /usr/local/etc/netatalk/atalkd.conf; netatalk-restart' | alias netatalk-router-on='sudo sed -i '"'"'s/^\([^# ]*\)\( .*\)$/\1 -router\2 -zone "A2SERVER"/'"'"' /usr/local/etc/netatalk/atalkd.conf; netatalk-restart' | ||||||
| alias netatalk-router-off='sudo sed -i '"'"'s/^eth0.*$/eth0/'"'"' /usr/local/etc/netatalk/atalkd.conf; sudo sed -i '"'"'s/^wlan0.*$/wlan0/'"'"' /usr/local/etc/netatalk/atalkd.conf; netatalk-restart' | alias netatalk-router-off='sudo sed -i '"'"'s/^\([^#].*\) -router\(.*\) -zone [^ ]*\(.*\)$/\1\2\3/'"'"' /usr/local/etc/netatalk/atalkd.conf; netatalk-restart' | ||||||
|  |  | ||||||
|  |  | ||||||
| alias netatalk-eth='sudo sed -i 's/^wlan0/eth0/' /usr/local/etc/netatalk/atalkd.conf; netatalk-restart' | alias netatalk-eth='sudo sed -i 's/^wlan0/eth0/' /usr/local/etc/netatalk/atalkd.conf; netatalk-restart' | ||||||
| @@ -42,7 +42,7 @@ alias netatalk-wifi='sudo sed -i 's/^eth0/wlan0/' /usr/local/etc/netatalk/atalkd | |||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| alias appletalk-off='sudo sed -i "s/ATALKD_RUN=yes/ATALKD_RUN=no/" /etc/default/netatalk; sudo killall macipgw > /dev/null; /etc/init.d/netatalk restart' | alias appletalk-off='sudo sed -i "s/ATALKD_RUN=yes/ATALKD_RUN=no/" /etc/default/netatalk; sudo /etc/init.d/netatalk restart' | ||||||
| alias appletalk-on='sudo sed -i "s/ATALKD_RUN=no/ATALKD_RUN=yes/" /etc/default/netatalk; sudo /etc/init.d/netatalk restart' | alias appletalk-on='sudo sed -i "s/ATALKD_RUN=no/ATALKD_RUN=yes/" /etc/default/netatalk; sudo /etc/init.d/netatalk restart' | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| #! /bin/bash | #! /bin/bash | ||||||
| # vim: set tabstop=4 shiftwidth=4 expandtab filetype=sh: | # vim: set tabstop=4 shiftwidth=4 expandtab filetype=sh: | ||||||
|  |  | ||||||
| export A2SERVER_SCRIPT_URL="${A2SERVER_SCRIPT_URL:-http://ivanx.com/a2server/}" | export A2SERVER_SCRIPT_URL="${A2SERVER_SCRIPT_URL:-https://raw.githubusercontent.com/RasppleII/a2server/current/}" | ||||||
| export A2SERVER_BINARY_URL="${A2SERVER_BINARY_URL:-http://ivanx.com/a2server/files/}" | export A2SERVER_BINARY_URL="${A2SERVER_BINARY_URL:-http://ivanx.com/a2server/files/}" | ||||||
| source /usr/local/etc/a2server-aliases | source /usr/local/etc/a2server-aliases | ||||||
|   | |||||||
| @@ -2,12 +2,11 @@ | |||||||
| # vim: set tabstop=4 shiftwidth=4 expandtab filetype=python: | # vim: set tabstop=4 shiftwidth=4 expandtab filetype=python: | ||||||
|  |  | ||||||
| """cppo: Copy/catalog files from a ProDOS/DOS 3.3/ShrinkIt image/archive. | """cppo: Copy/catalog files from a ProDOS/DOS 3.3/ShrinkIt image/archive. | ||||||
|     copy all files: |  | ||||||
|         cppo [options] imagefile target_directory | copy all files: cppo [options] imagefile target_directory | ||||||
|     copy one file: | copy one file : cppo [options] imagefile /extract/path target_path | ||||||
|         cppo [options] imagefile /extract/path target_path | catalog image : cppo -cat [options] imagefile | ||||||
|     catalog image: |  | ||||||
|         cppo -cat [options] imagefile |  | ||||||
| options: | options: | ||||||
| -shk: ShrinkIt archive as source (also auto-enabled by filename). | -shk: ShrinkIt archive as source (also auto-enabled by filename). | ||||||
| -ad : Netatalk-compatible AppleDouble metadata files and resource forks. | -ad : Netatalk-compatible AppleDouble metadata files and resource forks. | ||||||
| @@ -20,9 +19,9 @@ options: | |||||||
|     "MY FILENAME" (DOS 3.3 image source) |     "MY FILENAME" (DOS 3.3 image source) | ||||||
|     Dir:SubDir:FileName (ShrinkIt archive source) |     Dir:SubDir:FileName (ShrinkIt archive source) | ||||||
|  |  | ||||||
|  | + after a file name indicates a GS/OS or Mac OS extended (forked) file. | ||||||
| Wildcard matching (*) is not supported and images are not validated. | Wildcard matching (*) is not supported and images are not validated. | ||||||
| ShrinkIt support requires Nulib2. cppo requires Python 2.6+ or 3.0+. | ShrinkIt support requires Nulib2. cppo requires Python 2.6+ or 3.0+.""" | ||||||
| """ |  | ||||||
|  |  | ||||||
| # cppo by Ivan X, ivan@ivanx.com, ivanx.com/appleii | # cppo by Ivan X, ivan@ivanx.com, ivanx.com/appleii | ||||||
|  |  | ||||||
| @@ -42,6 +41,7 @@ import shutil | |||||||
| import errno | import errno | ||||||
| import uuid | import uuid | ||||||
| import subprocess | import subprocess | ||||||
|  | import tempfile | ||||||
|  |  | ||||||
| # Intentionally fails on pre-2.6 (no b'') so user can see what's wrong | # Intentionally fails on pre-2.6 (no b'') so user can see what's wrong | ||||||
| b'ERROR: cppo requires Python 2.6 or later, including 3.x.' | b'ERROR: cppo requires Python 2.6 or later, including 3.x.' | ||||||
| @@ -60,8 +60,7 @@ g.activeFileName = None | |||||||
| g.activeFileSize = None | g.activeFileSize = None | ||||||
| g.activeFileBytesCopied = 0 | g.activeFileBytesCopied = 0 | ||||||
| g.resourceFork = 0 | g.resourceFork = 0 | ||||||
| g.shk_hasrf = "" | g.shk_hasrf = False | ||||||
| g.shk_rfork = 0 |  | ||||||
|  |  | ||||||
| g.PDOSPATH = [] | g.PDOSPATH = [] | ||||||
| g.PDOSPATH_INDEX = 0 | g.PDOSPATH_INDEX = 0 | ||||||
| @@ -75,14 +74,15 @@ g.imageFile = None | |||||||
| g.extractFile = None | g.extractFile = None | ||||||
|  |  | ||||||
| # runtime options | # runtime options | ||||||
| g.AD = 0      # -ad  (AppleDouble headers + resource forks) | g.AD = 0       # -ad  (AppleDouble headers + resource forks) | ||||||
| g.EX = 0      # -e   (extended filenames + resource forks) | g.EX = 0       # -e   (extended filenames + resource forks) | ||||||
| g.DIR = 0     # -cat (catalog only, no extract) | g.CAT = 0      # -cat (catalog only, no extract) | ||||||
| g.UC = 0      # -uc  (GS/OS mixed case filenames extract as uppercase) | g.UC = 0       # -uc  (GS/OS mixed case filenames extract as uppercase) | ||||||
| g.SHK = 0     # -shk (ShrinkIt archive source) | g.SHK = 0      # -shk (ShrinkIt archive source) | ||||||
| g.D33 = 0     #      (DOS 3.3 image source, selected automatically) | g.PNAME = 0    # -pro (adapt DOS 3.3 names to ProDOS) | ||||||
| g.PNAME = 0   # -pro (adapt DOS 3.3 names to ProDOS) | g.nomsg = 0    # -s   (suppress afpsync message at end) | ||||||
| g.nomsg = 0   # -s   (suppress afpsync message at end) | g.nodir = 0    # -n   (don't create parent dir for SHK, extract files in place) | ||||||
|  | g.D33 = 0      #      (DOS 3.3 image source, selected automatically) | ||||||
|  |  | ||||||
| # functions | # functions | ||||||
|  |  | ||||||
| @@ -489,14 +489,16 @@ def processDir(arg1, arg2=None, arg3=None, arg4=None, arg5=None): | |||||||
|             g.DIRPATH = (g.DIRPATH + "/" + workingDirName) |             g.DIRPATH = (g.DIRPATH + "/" + workingDirName) | ||||||
|             if g.PDOSPATH_INDEX: |             if g.PDOSPATH_INDEX: | ||||||
|                 if (g.PDOSPATH_INDEX == 1): |                 if (g.PDOSPATH_INDEX == 1): | ||||||
|                     if (("/" + g.PDOSPATH_SEGMENT) != g.DIRPATH): |                     if (("/" + g.PDOSPATH_SEGMENT.lower()) != | ||||||
|  |                                g.DIRPATH.lower()): | ||||||
|                         print("ProDOS volume name does not match disk image.") |                         print("ProDOS volume name does not match disk image.") | ||||||
|                         sys.exit(2) |                         quitNow(2) | ||||||
|                     else: |                     else: | ||||||
|                         g.PDOSPATH_INDEX += 1 |                         g.PDOSPATH_INDEX += 1 | ||||||
|                         g.PDOSPATH_SEGMENT = g.PDOSPATH[g.PDOSPATH_INDEX] |                         g.PDOSPATH_SEGMENT = g.PDOSPATH[g.PDOSPATH_INDEX] | ||||||
|             else: |             else: | ||||||
|                 print(g.DIRPATH) |                 pass | ||||||
|  |                 # print(g.DIRPATH) | ||||||
|     while (pe < entryCount): |     while (pe < entryCount): | ||||||
|         if (getStorageType(arg1, e) > 0): |         if (getStorageType(arg1, e) > 0): | ||||||
|             #print(pe, e, entryCount) |             #print(pe, e, entryCount) | ||||||
| @@ -527,6 +529,8 @@ def processEntry(arg1, arg2): | |||||||
|     g.outFileData = bytearray(b'') |     g.outFileData = bytearray(b'') | ||||||
|     if g.SHK: # ShrinkIt archive |     if g.SHK: # ShrinkIt archive | ||||||
|         g.activeFileName = (arg2 if g.EX else arg2.split('#')[0]) |         g.activeFileName = (arg2 if g.EX else arg2.split('#')[0]) | ||||||
|  |         if g.UC: | ||||||
|  |             g.activeFileName = g.activeFileName.upper() | ||||||
|         origFileName = g.activeFileName |         origFileName = g.activeFileName | ||||||
|     else: # ProDOS or DOS 3.3 image |     else: # ProDOS or DOS 3.3 image | ||||||
|         g.activeFileName = getFileName(arg1 ,arg2).decode("L1") |         g.activeFileName = getFileName(arg1 ,arg2).decode("L1") | ||||||
| @@ -543,9 +547,9 @@ def processEntry(arg1, arg2): | |||||||
|             if not g.PDOSPATH_INDEX: |             if not g.PDOSPATH_INDEX: | ||||||
|                 g.targetDir = (g.targetDir + "/" + g.activeFileName) |                 g.targetDir = (g.targetDir + "/" + g.activeFileName) | ||||||
|             g.ADdir = (g.targetDir + "/.AppleDouble") |             g.ADdir = (g.targetDir + "/.AppleDouble") | ||||||
|             if not (g.DIR or os.path.isdir(g.targetDir)): |             if not (g.CAT or os.path.isdir(g.targetDir)): | ||||||
|                 makedirs(g.targetDir) |                 makedirs(g.targetDir) | ||||||
|             if not (g.DIR or (not g.AD) or os.path.isdir(g.ADdir)): |             if not (g.CAT or (not g.AD) or os.path.isdir(g.ADdir)): | ||||||
|                 makedirs(g.ADdir) |                 makedirs(g.ADdir) | ||||||
|             if g.PDOSPATH_SEGMENT: |             if g.PDOSPATH_SEGMENT: | ||||||
|                 g.PDOSPATH_INDEX += 1 |                 g.PDOSPATH_INDEX += 1 | ||||||
| @@ -556,17 +560,25 @@ def processEntry(arg1, arg2): | |||||||
|                 g.targetDir = g.targetDir.rsplit("/", 1)[0] |                 g.targetDir = g.targetDir.rsplit("/", 1)[0] | ||||||
|             g.ADdir = (g.targetDir + "/.AppleDouble") |             g.ADdir = (g.targetDir + "/.AppleDouble") | ||||||
|         else: # ProDOS or DOS 3.3 file either from image or ShrinkIt archive |         else: # ProDOS or DOS 3.3 file either from image or ShrinkIt archive | ||||||
|  |             dirPrint = "" | ||||||
|  |             if g.DIRPATH: | ||||||
|  |                 dirPrint = g.DIRPATH + "/" | ||||||
|  |             else: | ||||||
|  |                 if g.SHK: | ||||||
|  |                     if ("/".join(dirName.split('/')[3:])): | ||||||
|  |                         dirPrint = ("/".join(dirName.split('/')[3:]) + "/") | ||||||
|             if (not g.extractFile or |             if (not g.extractFile or | ||||||
|                (os.path.basename(g.extractFile) == |                (os.path.basename(g.extractFile.lower()) == | ||||||
|                 origFileName.split('#')[0])): |                 origFileName.split('#')[0].lower())): | ||||||
|                 print("   " + g.activeFileName.split("#")[0] + |                 filePrint = g.activeFileName.split("#")[0] | ||||||
|  |                 print(dirPrint + filePrint + | ||||||
|                      ("+" if (g.shk_hasrf or |                      ("+" if (g.shk_hasrf or | ||||||
|                              (not g.SHK and getStorageType(arg1, arg2) == 5)) |                              (not g.SHK and getStorageType(arg1, arg2) == 5)) | ||||||
|                           else "") + |                           else "") + | ||||||
|                      ((" [" + origFileName + "] ") |                      ((" [" + origFileName + "] ") | ||||||
|                        if (g.PNAME and (origFileName != g.activeFileName)) |                        if (g.PNAME and (origFileName != g.activeFileName)) | ||||||
|                        else "")) |                        else "")) | ||||||
|                 if g.DIR: |                 if g.CAT: | ||||||
|                     return |                     return | ||||||
|                 if not g.targetName: |                 if not g.targetName: | ||||||
|                     g.targetName = g.activeFileName |                     g.targetName = g.activeFileName | ||||||
| @@ -616,8 +628,10 @@ def processEntry(arg1, arg2): | |||||||
|                     if (g.exFileData != None): |                     if (g.exFileData != None): | ||||||
|                         saveFile((saveName + "r"), g.exFileData) |                         saveFile((saveName + "r"), g.exFileData) | ||||||
|                         touch((saveName + "r"), modifiedDate) |                         touch((saveName + "r"), modifiedDate) | ||||||
|                 if g.PDOSPATH_SEGMENT or (g.extractFile == origFileName): |                 if (g.PDOSPATH_SEGMENT or | ||||||
|                     syncExit() |                    (g.extractFile and | ||||||
|  |                    (g.extractFile.lower() == origFileName.lower()))): | ||||||
|  |                     quitNow(0) | ||||||
|                 g.targetName = None     |                 g.targetName = None     | ||||||
|     #else: |     #else: | ||||||
|         #print(g.activeFileName + " doesn't match " + g.PDOSPATH_SEGMENT) |         #print(g.activeFileName + " doesn't match " + g.PDOSPATH_SEGMENT) | ||||||
| @@ -729,17 +743,21 @@ def makeADfile(): | |||||||
|     writecharsHex(g.exFileData, hexToDec("7A"), "0000000F000002AD00000004") |     writecharsHex(g.exFileData, hexToDec("7A"), "0000000F000002AD00000004") | ||||||
|     # dbd (second time) will create DEV, INO, SYN, SV~ |     # dbd (second time) will create DEV, INO, SYN, SV~ | ||||||
|  |  | ||||||
| def syncExit(): | def quitNow(exitCode=0): | ||||||
|     if (not g.nomsg and g.AD and os.path.isdir("/usr/local/etc/netatalk")): |     if (exitCode == 0 and not g.nomsg and | ||||||
|  |         g.AD and os.path.isdir("/usr/local/etc/netatalk")): | ||||||
|         print("File(s) have been copied to the target directory. " + |         print("File(s) have been copied to the target directory. " + | ||||||
|               "If the directory") |               "If the directory") | ||||||
|         print("is shared by Netatalk, please type 'afpsync' now.") |         print("is shared by Netatalk, please type 'afpsync' now.") | ||||||
|     # saveFile(g.imageFile, g.imageData) |     if g.SHK: # clean up | ||||||
|     sys.exit(0) |         for file in os.listdir('/tmp'): | ||||||
|  |             if file.startswith("cppo-"): | ||||||
|  |                 shutil.rmtree('/tmp' + "/" + file) | ||||||
|  |     sys.exit(exitCode) | ||||||
|  |  | ||||||
| def usage(exitcode=1): | def usage(exitcode=1): | ||||||
|     print(sys.modules[__name__].__doc__) |     print(sys.modules[__name__].__doc__) | ||||||
|     sys.exit(exitcode) |     quitNow(exitcode) | ||||||
|  |  | ||||||
| # --- ID bashbyter functions (adapted) | # --- ID bashbyter functions (adapted) | ||||||
|  |  | ||||||
| @@ -1080,6 +1098,7 @@ def isnumber(number): | |||||||
| args = sys.argv | args = sys.argv | ||||||
|  |  | ||||||
| while True: # breaks when there are no more arguments starting with dash | while True: # breaks when there are no more arguments starting with dash | ||||||
|  |  | ||||||
|     if (len(args) == 1): |     if (len(args) == 1): | ||||||
|         usage() |         usage() | ||||||
|          |          | ||||||
| @@ -1090,12 +1109,15 @@ while True: # breaks when there are no more arguments starting with dash | |||||||
|         g.nomsg = 1 |         g.nomsg = 1 | ||||||
|         args = args[1:] #shift |         args = args[1:] #shift | ||||||
|      |      | ||||||
|  |     elif (args[1] == "-n"): | ||||||
|  |         g.nodir = 1 | ||||||
|  |         args = args[1:] #shift | ||||||
|  |  | ||||||
|     elif (args[1] == "-uc"): |     elif (args[1] == "-uc"): | ||||||
|         g.UC = 1 |         g.UC = 1 | ||||||
|         args = args[1:] #shift |         args = args[1:] #shift | ||||||
|  |  | ||||||
|     elif (args[1] == "-ad"): |     elif (args[1] == "-ad"): | ||||||
|         if g.EX: usage() |  | ||||||
|         g.AD = 1 |         g.AD = 1 | ||||||
|         g.PNAME = 1 |         g.PNAME = 1 | ||||||
|         args = args[1:] #shift |         args = args[1:] #shift | ||||||
| @@ -1109,26 +1131,30 @@ while True: # breaks when there are no more arguments starting with dash | |||||||
|         args = args[1:] #shift |         args = args[1:] #shift | ||||||
|  |  | ||||||
|     elif (args[1] == "-e"): |     elif (args[1] == "-e"): | ||||||
|         if g.AD: usage() |  | ||||||
|         g.EX = 1 |         g.EX = 1 | ||||||
|         g.PNAME = 1 |         g.PNAME = 1 | ||||||
|         args = args[1:] #shift |         args = args[1:] #shift | ||||||
|  |  | ||||||
|     elif (args[1] == "-cat"): |     elif (args[1] == "-cat"): | ||||||
|         if g.AD or g.EX: usage() |         g.CAT = 1 | ||||||
|         g.DIR = 1 |  | ||||||
|         args = args[1:] #shift |         args = args[1:] #shift | ||||||
|  |  | ||||||
|     else: |     else: | ||||||
|         usage() |         usage() | ||||||
|  |  | ||||||
| if not ((g.DIR and len(args) >= 2) or (len(args) >= 3)): | if g.EX: | ||||||
|     usage() |     if g.AD: usage() | ||||||
|  | if g.AD: | ||||||
|  |     if g.EX: usage() | ||||||
|  | if g.CAT: | ||||||
|  |     if not (len(args) == 2): usage() | ||||||
|  | else: | ||||||
|  |     if not ((len(args) == 3) or (len(args) == 4)): usage() | ||||||
|  |  | ||||||
| g.imageFile = args[1] | g.imageFile = args[1] | ||||||
| if not os.path.isfile(g.imageFile): | if not os.path.isfile(g.imageFile): | ||||||
|     print("Image/archive file \"" + g.imageFile + "\" was not found.") |     print("Image/archive file \"" + g.imageFile + "\" was not found.") | ||||||
|     sys.exit(2) |     quitNow(2) | ||||||
|  |  | ||||||
| # automatically set ShrinkIt mode if extension suggests it | # automatically set ShrinkIt mode if extension suggests it | ||||||
| if (g.SHK or | if (g.SHK or | ||||||
| @@ -1137,7 +1163,7 @@ if (g.SHK or | |||||||
|     g.imageFile[-3:].lower() == "bxy"): |     g.imageFile[-3:].lower() == "bxy"): | ||||||
|     if (os.name == "nt"): |     if (os.name == "nt"): | ||||||
|         print("ShrinkIt archives cannot be extracted on Windows.") |         print("ShrinkIt archives cannot be extracted on Windows.") | ||||||
|         sys.exit(2) |         quitNow(2) | ||||||
|     else: |     else: | ||||||
|         try: |         try: | ||||||
|             with open(os.devnull, "w") as fnull: |             with open(os.devnull, "w") as fnull: | ||||||
| @@ -1145,81 +1171,117 @@ if (g.SHK or | |||||||
|             g.SHK=1 |             g.SHK=1 | ||||||
|         except Exception: |         except Exception: | ||||||
|             print("Nulib2 is not available; not expanding ShrinkIt archive.") |             print("Nulib2 is not available; not expanding ShrinkIt archive.") | ||||||
|             sys.exit(2) |             quitNow(2) | ||||||
|  |  | ||||||
| if (len(args) == 4): | if (len(args) == 4): | ||||||
|     g.extractFile = args[2] |     g.extractFile = args[2] | ||||||
|  |  | ||||||
|  | if g.extractFile: | ||||||
|  |     targetPath = args[3] | ||||||
|  |     if os.path.isdir(targetPath): | ||||||
|  |         g.targetDir = targetPath | ||||||
|  |     elif (targetPath.rsplit("/", 1) > 1): | ||||||
|  |         g.targetDir = targetPath.rsplit("/", 1)[0] | ||||||
|  |         g.targetName = targetPath.rsplit("/", 1)[1] | ||||||
|  |     if not os.path.isdir(g.targetDir): | ||||||
|  |         print("Target directory not found.") | ||||||
|  |         quitNow(2) | ||||||
|  | else: | ||||||
|  |     if not g.CAT: | ||||||
|  |         if not os.path.isdir(args[2]): | ||||||
|  |             print("Target directory not found.") | ||||||
|  |             quitNow(2) | ||||||
|  |      | ||||||
| if g.SHK: | if g.SHK: | ||||||
|     g.PNAME = 0 |     g.PNAME = 0 | ||||||
|     if not g.DIR: |     if not g.CAT: | ||||||
|         targetDir = (args[3] if g.extractFile else args[2]) |         targetDir = (args[3] if g.extractFile else args[2]) | ||||||
|     unshkdir = ("/tmp/cppo-" + str(uuid.uuid4())) |     unshkdir = ('/tmp' + "/cppo-" + str(uuid.uuid4())) | ||||||
|     makedirs(unshkdir) |     makedirs(unshkdir) | ||||||
|     if not os.system("cd " + unshkdir + "; " + |     result = os.system("/bin/bash -c 'cd " + unshkdir + "; " + | ||||||
|                      "nulib2 -xse " + |                        "result=$(nulib2 -xse " + os.path.abspath(g.imageFile) + | ||||||
|                      os.path.abspath(g.imageFile) + " " + |                        ((" " + args[2].replace('/', ':')) | ||||||
|                      (args[2].replace('/', ':') if g.extractFile else "") + |                        if g.extractFile else "") + " 2> /dev/null); " + | ||||||
|                      " | grep -q 'no records match' > /dev/null"): |                        "if [[ $result == \"Failed.\" ]]; then exit 3; " + | ||||||
|  |                        "else if grep -q \"no records match\" <<< \"$result\"" + | ||||||
|  |                        " > /dev/null; then exit 2; else exit 0; fi; fi'") | ||||||
|  |     if (result == 512): | ||||||
|         print( |         print( | ||||||
|           "File not found in ShrinkIt archive. Try cppo -cat to get the path,") |           "File not found in ShrinkIt archive. Try cppo -cat to get the path,") | ||||||
|         print("  and omit any leading slash or colon.") |         print("  and omit any leading slash or colon.") | ||||||
|         sys.exit(1) |         quitNow(1) | ||||||
|  |     elif (result != 0): | ||||||
|  |         print("ShrinkIt archive is invalid, or some other problem happened.") | ||||||
|  |         quitNow(1) | ||||||
|     if g.extractFile: |     if g.extractFile: | ||||||
|         g.extractFile = g.extractFile.replace(':', '/') |         g.extractFile = g.extractFile.replace(':', '/') | ||||||
|         extractPath = (unshkdir + "/" + g.extractFile) |         extractPath = (unshkdir + "/" + g.extractFile) | ||||||
|         extractPathDir = os.path.dirname(extractPath) |         extractPathDir = os.path.dirname(extractPath) | ||||||
|         # move the extracted file to the root |         # move the extracted file to the root | ||||||
|         newunshkdir = ("/tmp/cppo-" + str(uuid.uuid4())) |         newunshkdir = ('/tmp' + "/cppo-" + str(uuid.uuid4())) | ||||||
|         makedirs(newunshkdir) |         makedirs(newunshkdir) | ||||||
|         for filename in os.listdir(extractPathDir): |         for filename in os.listdir(extractPathDir): | ||||||
|             shutil.move(extractPathDir + "/" + filename, newunshkdir) |             shutil.move(extractPathDir + "/" + filename, newunshkdir) | ||||||
|         shutil.rmtree(unshkdir) |         shutil.rmtree(unshkdir) | ||||||
|         unshkdir = newunshkdir |         unshkdir = newunshkdir | ||||||
|  |  | ||||||
|     fileNames = [name for name in os.listdir(unshkdir) |     fileNames = [name for name in sorted(os.listdir(unshkdir)) | ||||||
|                  if not name.startswith(".")] |                  if not name.startswith(".")] | ||||||
|     if (len(fileNames) == 1 and os.path.isdir(unshkdir + "/" + fileNames[0])): |     if g.nodir: # extract in place from "-n" | ||||||
|         oneDir = True |         curDir = True | ||||||
|  |     elif (len(fileNames) == 1 and | ||||||
|  |           os.path.isdir(unshkdir + "/" + fileNames[0])): | ||||||
|  |         curDir = True # only one folder at top level, so extract in place | ||||||
|         volumeName = toProdosName(fileNames[0]) |         volumeName = toProdosName(fileNames[0]) | ||||||
|     else: |     elif (len(fileNames) == 1 and    # disk image, so extract in place | ||||||
|         oneDir = False |           fileNames[0][-1:] == "i"): | ||||||
|  |         curDir = True | ||||||
|  |         volumeName = toProdosName(fileNames[0].split("#")[0]) | ||||||
|  |     else: # extract in folder based on disk image name | ||||||
|  |         curDir = False | ||||||
|         volumeName = toProdosName(os.path.basename(g.imageFile)) |         volumeName = toProdosName(os.path.basename(g.imageFile)) | ||||||
|         if (volumeName[-4:].lower() == ".shk" or |         if (volumeName[-4:].lower() == ".shk" or | ||||||
|             volumeName[-4:].lower() == ".sdk" or |             volumeName[-4:].lower() == ".sdk" or | ||||||
|             volumeName[-4:].lower() == ".bxy"): |             volumeName[-4:].lower() == ".bxy"): | ||||||
|             volumeName = volumeName[0:-4] |             volumeName = volumeName[0:-4] | ||||||
|     if not g.DIR and not g.extractFile: |     if not g.CAT and not curDir and not g.extractFile: | ||||||
|         print("Extracting into " + volumeName) |         print("Extracting into " + volumeName) | ||||||
|     # recursively process unshrunk archive hierarchy |     # recursively process unshrunk archive hierarchy | ||||||
|     for dirName, subdirList, fileList in os.walk(unshkdir): |     for dirName, subdirList, fileList in os.walk(unshkdir): | ||||||
|         subdirList.sort() |         subdirList.sort() | ||||||
|         if not g.DIR: |         if not g.CAT: | ||||||
|             g.targetDir = (targetDir + ("" if oneDir else ("/" + volumeName)) + |             g.targetDir = (targetDir + ("" if curDir else ("/" + volumeName)) + | ||||||
|                           ("/" if (dirName.count('/') > 2) else "") + |                           ("/" if (dirName.count('/') > 2) else "") + | ||||||
|                           ("/".join(dirName.split('/')[3:]))) # chop tempdir |                           ("/".join(dirName.split('/')[3:]))) # chop tempdir | ||||||
|             if g.extractFile: # solo item, so don't put it in the tree |             if g.extractFile: # solo item, so don't put it in the tree | ||||||
|                 g.targetDir = targetDir |                 g.targetDir = targetDir | ||||||
|  |             if g.UC: | ||||||
|  |                 g.targetDir = g.targetDir.upper() | ||||||
|             g.ADdir = (g.targetDir + "/.AppleDouble") |             g.ADdir = (g.targetDir + "/.AppleDouble") | ||||||
|             makedirs(g.targetDir) |             makedirs(g.targetDir) | ||||||
|             if g.AD: |             if g.AD: | ||||||
|                 makedirs(g.ADdir) |                 makedirs(g.ADdir) | ||||||
|         if not g.extractFile: |  | ||||||
|             print("/".join(dirName.split('/')[3:]) |  | ||||||
|                   if "/".join(dirName.split('/')[3:]) |  | ||||||
|                   else "(top level)") |  | ||||||
|         for fname in sorted(fileList): |         for fname in sorted(fileList): | ||||||
|             g.shk_hasrf = "" |             if (fname[-1:] == "i"): | ||||||
|             g.shk_rfork = False |                 # disk image; rename to include suffix and correct type/auxtype | ||||||
|  |                 imagePath = os.path.join(dirName, fname).split("#")[0] | ||||||
|  |                 new_name = (imagePath + | ||||||
|  |                            ("" if (imagePath.lower().endswith(".po") or | ||||||
|  |                                    imagePath.lower().endswith(".hdv")) | ||||||
|  |                                else ".PO") + "#e00005") | ||||||
|  |                 os.rename(os.path.join(dirName, fname), new_name) | ||||||
|  |                 fname = os.path.basename(new_name) | ||||||
|  |             g.shk_hasrf = False | ||||||
|  |             rfork = False | ||||||
|             if (fname[-1:] == "r" and |             if (fname[-1:] == "r" and | ||||||
|                 os.path.isfile(os.path.join(dirName, fname[:-1]))): |                 os.path.isfile(os.path.join(dirName, fname[:-1]))): | ||||||
|                 g.shk_rfork = True |                 rfork = True | ||||||
|             elif (os.path.isfile(os.path.join(dirName, (fname + "r")))): |             elif (os.path.isfile(os.path.join(dirName, (fname + "r")))): | ||||||
|                 g.shk_hasrf = "+" |                 g.shk_hasrf = True | ||||||
|             if not g.shk_rfork: |             if not rfork: | ||||||
|                 processEntry(dirName, fname) |                 processEntry(dirName, fname) | ||||||
|     shutil.rmtree(unshkdir, True) |     shutil.rmtree(unshkdir, True) | ||||||
|     syncExit() |     quitNow(0) | ||||||
|  |  | ||||||
| # end script if SHK | # end script if SHK | ||||||
|              |              | ||||||
| @@ -1295,22 +1357,6 @@ if (not g.SHK and | |||||||
|     (slyce(args[2],0,1) != ":")): |     (slyce(args[2],0,1) != ":")): | ||||||
|     usage() |     usage() | ||||||
|  |  | ||||||
| if g.extractFile: |  | ||||||
|     targetPath = args[3] |  | ||||||
|     if os.path.isdir(targetPath): |  | ||||||
|         g.targetDir = targetPath |  | ||||||
|     else: |  | ||||||
|         g.targetDir = targetPath.rsplit("/", 1)[0] |  | ||||||
|         g.targetName = targetPath.rsplit("/", 1)[1] |  | ||||||
|     if not os.path.isdir(g.targetDir): |  | ||||||
|         print("Target directory not found.") |  | ||||||
|         sys.exit(2) |  | ||||||
| else: |  | ||||||
|     if not g.DIR: |  | ||||||
|         if not os.path.isdir(args[2]): |  | ||||||
|             print("Target directory not found.") |  | ||||||
|             sys.exit(2) |  | ||||||
|      |  | ||||||
| if g.D33: | if g.D33: | ||||||
|     diskName = os.path.basename(g.imageFile) |     diskName = os.path.basename(g.imageFile) | ||||||
|     if (diskName[-4:].lower() == ".dsk" or |     if (diskName[-4:].lower() == ".dsk" or | ||||||
| @@ -1319,7 +1365,7 @@ if g.D33: | |||||||
|         diskName = os.path.splitext(diskName)[0] |         diskName = os.path.splitext(diskName)[0] | ||||||
|     if g.PNAME: |     if g.PNAME: | ||||||
|         diskName = toProdosName(diskName) |         diskName = toProdosName(diskName) | ||||||
|     if not g.DIR: |     if not g.CAT: | ||||||
|         g.targetDir = (args[3] if g.extractFile |         g.targetDir = (args[3] if g.extractFile | ||||||
|                                else (args[2] + "/" + diskName)) |                                else (args[2] + "/" + diskName)) | ||||||
|         g.ADdir = (g.targetDir + "/.AppleDouble") |         g.ADdir = (g.targetDir + "/.AppleDouble") | ||||||
| @@ -1332,7 +1378,7 @@ if g.D33: | |||||||
|                 readcharDec(g.imageData, ts(17,0)+2)]) |                 readcharDec(g.imageData, ts(17,0)+2)]) | ||||||
|     if g.extractFile: |     if g.extractFile: | ||||||
|         print("ProDOS file not found within image file.") |         print("ProDOS file not found within image file.") | ||||||
|     syncExit() |     quitNow(0) | ||||||
|  |  | ||||||
| # below: ProDOS | # below: ProDOS | ||||||
|  |  | ||||||
| @@ -1355,9 +1401,9 @@ if g.extractFile: | |||||||
|         mkdir(g.ADdir) |         mkdir(g.ADdir) | ||||||
|     processDir(2) |     processDir(2) | ||||||
|     print("ProDOS file not found within image file.") |     print("ProDOS file not found within image file.") | ||||||
|     sys.exit(2) |     quitNow(2) | ||||||
| else: | else: | ||||||
|     if not g.DIR: |     if not g.CAT: | ||||||
|         # print(args[0], args[1], args[2]) |         # print(args[0], args[1], args[2]) | ||||||
|         g.targetDir = (args[2] + "/" + getVolumeName().decode("L1")) |         g.targetDir = (args[2] + "/" + getVolumeName().decode("L1")) | ||||||
|         g.ADdir = (g.targetDir + "/.AppleDouble") |         g.ADdir = (g.targetDir + "/.AppleDouble") | ||||||
| @@ -1366,6 +1412,6 @@ else: | |||||||
|         if not ((not g.AD) or os.path.isdir(g.ADdir)): |         if not ((not g.AD) or os.path.isdir(g.ADdir)): | ||||||
|             makedirs(g.ADdir) |             makedirs(g.ADdir) | ||||||
|     processDir(2) |     processDir(2) | ||||||
|     if not g.DIR: |     if not g.CAT: | ||||||
|         syncExit() |         quitNow(0) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -9,12 +9,12 @@ | |||||||
| # to download and execute, type: | # to download and execute, type: | ||||||
| # wget ivanx.com/a2server/setup; source setup | # wget ivanx.com/a2server/setup; source setup | ||||||
|  |  | ||||||
| a2serverVersion="1.2.9" | a2serverVersion="151" | ||||||
|  |  | ||||||
| # 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" ;; | ||||||
| 	*) scriptURL="${A2SERVER_SCRIPT_URL:-http://ivanx.com/a2server}/" ;; | 	*) scriptURL="${A2SERVER_SCRIPT_URL:-https://raw.githubusercontent.com/RasppleII/a2server/current}/" ;; | ||||||
| esac | esac | ||||||
| case "$A2SERVER_BINARY_URL" in | case "$A2SERVER_BINARY_URL" in | ||||||
| 	*/) binaryURL="$A2SERVER_BINARY_URL" ;; | 	*/) binaryURL="$A2SERVER_BINARY_URL" ;; | ||||||
| @@ -27,20 +27,22 @@ isRpi= | |||||||
| [[ -f /usr/bin/raspi-config ]] && isRpi=1 | [[ -f /usr/bin/raspi-config ]] && isRpi=1 | ||||||
|  |  | ||||||
| isDebian= | isDebian= | ||||||
| lsb_release -a 2> /dev/null | grep -q 'Distributor ID:.Debian' && [[ ( -f /etc/debian_version ) && ( $(cut -c 1 < /etc/debian_version) -ge "7" ) ]] && isDebian=1 | lsb_release -a 2> /dev/null | grep -q 'Distributor ID:.Debian' && [[ ( -f /etc/debian_version ) && ( $(cut -d . -f 1 < /etc/debian_version) -ge "7" ) ]] && isDebian=1 | ||||||
|  |  | ||||||
| if [[ -f /usr/local/etc/A2SERVER-version ]]; then | if [ -f /usr/local/etc/A2SERVER-version ]; then | ||||||
|     echo "A2SERVER version available: $a2serverVersion" |     installedVersion="$(cat /usr/local/etc/A2SERVER-version)" | ||||||
|     echo "A2SERVER version installed: $(cat /usr/local/etc/A2SERVER-version)" |  | ||||||
| fi | fi | ||||||
|  | echo "A2SERVER version available: $a2serverVersion" | ||||||
|  | echo "A2SERVER version installed: ${installedVersion:=None}" | ||||||
|  |  | ||||||
| echo | echo | ||||||
| [[ $scriptURL != *"ivanx.com"* ]] && echo "Using script URL: $scriptURL" | [[ $scriptURL != *"ivanx.com"* && $scriptURL != *"raw.githubusercontent.com/RasppleII/a2server"* ]] && echo "Using script URL: $scriptURL" | ||||||
| [[ $binaryURL != *"ivanx.com"* ]] && echo "Using binary URL: $binaryURL" | [[ $binaryURL != *"ivanx.com"* ]] && echo "Using binary URL: $binaryURL" | ||||||
| [[ ! $useExternalURL ]] && echo -e "Not using external URLs. Payloads must be in:\n  ${binaryURL}external\n  (See A2SERVER developer page for more information.)" | [[ ! $useExternalURL ]] && echo -e "Not using external URLs. Downloads must be available from:\n  ${binaryURL}external/appleii/\n  ${binaryURL}external/source/\n  (See the A2SERVER developer page for more information.)" | ||||||
|  |  | ||||||
| skipRepoUpdate= | skipRepoUpdate= | ||||||
| autoAnswerYes= | autoAnswerYes= | ||||||
|  | installAll= | ||||||
| setupNetBoot= | setupNetBoot= | ||||||
| setupWindowsSharing= | setupWindowsSharing= | ||||||
| compileAlways= | compileAlways= | ||||||
| @@ -51,6 +53,9 @@ while [[ $1 ]]; do | |||||||
|         shift |         shift | ||||||
|         skipRepoUpdate="-r" |         skipRepoUpdate="-r" | ||||||
|         touch /tmp/a2server-packageReposUpdated |         touch /tmp/a2server-packageReposUpdated | ||||||
|  |     elif [[ $1 == "-i" ]]; then | ||||||
|  |         shift | ||||||
|  |         installAll="-i" | ||||||
|     elif [[ $1 == "-y" ]]; then |     elif [[ $1 == "-y" ]]; then | ||||||
|         shift |         shift | ||||||
|         autoAnswerYes="-y" |         autoAnswerYes="-y" | ||||||
| @@ -73,14 +78,12 @@ while [[ $1 ]]; do | |||||||
|         updateRasppleII=1 |         updateRasppleII=1 | ||||||
|     elif [[ $1 == "-v" ]]; then |     elif [[ $1 == "-v" ]]; then | ||||||
|         shift |         shift | ||||||
|         if [[ ! -f /usr/local/etc/A2SERVER-version ]]; then |         # Version was already printed | ||||||
|             echo "A2SERVER version available: $a2serverVersion" |  | ||||||
|             echo "A2SERVER version installed: none" |  | ||||||
|         fi |  | ||||||
|         [[ $0 == "-bash" ]] && return 1 || exit 1 |         [[ $0 == "-bash" ]] && return 1 || exit 1 | ||||||
|     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 "-i: reinstall A2SERVER software (but not Apple II software)" | ||||||
|         echo "-y: auto-answer yes 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)" | ||||||
| @@ -111,6 +114,10 @@ fi | |||||||
| a2server_update=0 | a2server_update=0 | ||||||
| doSetup=1 | doSetup=1 | ||||||
|  |  | ||||||
|  | if { [[ -f /usr/local/etc/A2SERVER-version ]] && (( $(head -c 3 /usr/local/etc/A2SERVER-version) < 151 )); }; then | ||||||
|  |     a2server_update=1 | ||||||
|  | fi | ||||||
|  |  | ||||||
| unsupportedOS=1 | unsupportedOS=1 | ||||||
| if [[ $isRpi ]]; then #supported Raspbian? (16-Feb-15, 20-Jun-14, 09-Jan-14, etc) | 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=$(zcat /usr/share/doc/raspberrypi-bootloader/changelog.Debian.gz | grep -m 1 'as of' | awk '{print $NF}') | ||||||
| @@ -142,13 +149,12 @@ if [[ $unsupportedOS ]]; then | |||||||
|     echo |     echo | ||||||
|     echo "WARNING: A2SERVER and its installer scripts have only been tested on" |     echo "WARNING: A2SERVER and its installer scripts have only been tested on" | ||||||
|     echo "Debian and Raspbian. Continuing is probably fine, but might not be." |     echo "Debian and Raspbian. Continuing is probably fine, but might not be." | ||||||
|     echo "Worst case could make your operating system no longer work properly," |     echo "Theoretical worst case would be your operating system no longer works" | ||||||
|     echo "or cause data to be lost." |     echo "properly or data is lost, so consider backing up first." | ||||||
|     echo "More information is at http://ivanx.com/a2server." |  | ||||||
| fi | fi | ||||||
|  |  | ||||||
| doSetup=1 | doSetup=1 | ||||||
| if [[ ! -f /usr/local/etc/a2server-help.txt ]] || (( $a2server_update )); then | if [[ $installAll || ! -f /usr/local/etc/a2server-help.txt ]] || (( $a2server_update )); then | ||||||
|     echo |     echo | ||||||
|     echo "Setting up A2SERVER will take up to 60 minutes, during which" |     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 "you'll see a bunch of stuff spit out across the screen." | ||||||
| @@ -229,6 +235,16 @@ if (( $doSetup )); then | |||||||
|  |  | ||||||
|         echo "A2SERVER: Scripts have been downloaded. Installing..." |         echo "A2SERVER: Scripts have been downloaded. Installing..." | ||||||
|  |  | ||||||
|  |         if [[ $installAll ]]; then | ||||||
|  |             sudo rm /usr/local/etc/A2SERVER-version 2> /dev/null | ||||||
|  |             sudo rm /usr/local/bin/nulib2 2> /dev/null | ||||||
|  |             sudo rm /usr/local/bin/unar 2> /dev/null | ||||||
|  |             sudo rm /usr/local/sbin/macipgw 2> /dev/null | ||||||
|  |             sudo rm /usr/local/bin/ciopfs 2> /dev/null | ||||||
|  |             sudo rm /usr/local/etc/netatalk/afppasswd 2> /dev/null | ||||||
|  |             sudo rm /usr/local/etc/netatalk/a2boot/p8 /usr/local/etc/netatalk/a2boot/ProDOS16\ Image 2> /dev/null | ||||||
|  |         fi | ||||||
|  |  | ||||||
|         /tmp/1.storage |         /tmp/1.storage | ||||||
|         rm /tmp/1.storage |         rm /tmp/1.storage | ||||||
|         /tmp/2.tools |         /tmp/2.tools | ||||||
| @@ -264,9 +280,10 @@ if (( $doSetup )); then | |||||||
|             echo "via the AppleShare control panel." |             echo "via the AppleShare control panel." | ||||||
|             if [[ -f /srv/A2SERVER/A2FILES/System/Start.GS.OS ]]; then |             if [[ -f /srv/A2SERVER/A2FILES/System/Start.GS.OS ]]; then | ||||||
|                 echo                 |                 echo                 | ||||||
|                 echo "You can network boot GS/OS. On a ROM 01 IIgs, set slot 1 or 2, and slot 7," |                 echo "You can network boot GS/OS." | ||||||
|                 echo 'to AppleTalk, and Startup Slot to 7 or "Scan". On a ROM 3 IIgs, set' |                 echo "On a ROM 01 IIgs, set slot 1 (printer port), or slot 2 (modem port)" | ||||||
|                 echo "slot 1 or 2, and Startup Slot, to AppleTalk." |                 echo "to Your Card, and slot 7 to AppleTalk, and Startup Slot to 7 or Scan." | ||||||
|  |                 echo "On a ROM 3 IIgs, set slot 1 or 2, and Startup Slot, to AppleTalk." | ||||||
|             fi |             fi | ||||||
|             if [[ -f /srv/A2SERVER/A2FILES/BASIC.System ]]; then |             if [[ -f /srv/A2SERVER/A2FILES/BASIC.System ]]; then | ||||||
|                 echo |                 echo | ||||||
|   | |||||||
							
								
								
									
										108
									
								
								update/devhistory.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										108
									
								
								update/devhistory.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,108 @@ | |||||||
|  | 1.0.0: Jan 2012: initial release | ||||||
|  |  | ||||||
|  | 1.0.1: Jan 2012: fixes Netatalk date-stamp bug (thanks to Steven Hirsch) | ||||||
|  |  | ||||||
|  | 1.0.2: Jan 2013: Netatalk 2.2.4; OS X 10.7+ login fixed; netboot fixes; | ||||||
|  |                  Raspbian "Wheezy" support; Ubuntu 12.04 LTS support | ||||||
|  |  | ||||||
|  | 1.1.0: Apr 2013: Full GS/OS install; eliminated GS.SYSTEM volume; | ||||||
|  |                  Raspberry Pi enhancements; lots of improvements to installer; | ||||||
|  |                  more utilities installed for Apple II; improved cppo | ||||||
|  |                  NOTE: fresh install required, can't update earlier version | ||||||
|  |  | ||||||
|  | 1.1.1: Jun 2013: Wi-Fi support; updates/additions to commands in a2server-help; | ||||||
|  |                  bug fixes and improvements to install script; appletalk kernel | ||||||
|  |                  module for Raspbian (instead of replacement kernel); RPi | ||||||
|  |                  console (onboard serial) set to 19,200 bps during boot | ||||||
|  |  | ||||||
|  | 1.1.2: Oct 2013: resolves issue of no AppleTalk in Raspbian 2013-09-10 and | ||||||
|  |                  later; faster command-line installation on Raspberry Pi | ||||||
|  |                  (nulib2 and unar binaries are downloaded rather than compiled) | ||||||
|  |  | ||||||
|  | 1.1.3: Jan 2014: shares ADTPro disks folder as ADTDISKS; added environment | ||||||
|  |                  variables for shared folders; can resolve by name | ||||||
|  |                  "a2server.local" if network client has Bonjour/zeroconf; | ||||||
|  |                  server presents itself as Shared computer to Macs on network; | ||||||
|  |                  VM based on Debian 7 | ||||||
|  |  | ||||||
|  | 1.1.4: Jan 2014: fixes bug with network boot if ADTPro disks folder is shared | ||||||
|  |  | ||||||
|  | 1.1.5: Jul 2014: a2server-setup fixes Raspbian 20-Jul-14 AppleTalk kernel panic | ||||||
|  |  | ||||||
|  | 1.2.0: Aug 2014: a2server-setup and Netatalk startup script addresses AppleTalk | ||||||
|  |                  kernel panic on any Linux kernel 3.12-3.15; Netatalk starts | ||||||
|  |                  in background, preventing startup delay; a2server-setup always | ||||||
|  |                  configures Netatalk startup script and can download a new one | ||||||
|  |                  if missing; a2server-setup on Raspbian or Debian 7 x86 is | ||||||
|  |                  faster because it downloads binaries rather than compiling | ||||||
|  |                  from source; unbit/unexec/usq unarchivers added; additional | ||||||
|  |                  virtual machine which has both A2SERVER and A2CLOUD installed | ||||||
|  |  | ||||||
|  | 1.2.1: Jan 2015: minor fixes; support for LED blink on Raspbian 2015-01-31 | ||||||
|  |  | ||||||
|  | 1.2.2: Mar 2015: installer improvements: now has command line options, | ||||||
|  |                  including unattended install; installer sets passwords | ||||||
|  |                  automatically to 'apple2'; status messages are now prefixed by | ||||||
|  |                  A2SERVER:; can update Raspple II (Raspbian OS, | ||||||
|  |                  NOOBS install manager, A2SERVER, and A2CLOUD); minor fixes. | ||||||
|  |  | ||||||
|  | 1.2.3: May 2015: changed Apple software links to Internet Archive | ||||||
|  |  | ||||||
|  | 1.2.4: Jul 2015: offer to download A2CLOUD disk contents onto A2FILES volume | ||||||
|  |  | ||||||
|  | 1.2.4+:Oct 2015: support for using A2SERVER scripts from a location other than | ||||||
|  | [unannounced]    ivanx.com/a2server for development purposes | ||||||
|  |  | ||||||
|  | 1.2.5: Nov 2015: netboot install option for GS/OS 6.0.2/3 | ||||||
|  |                  netboot always downloads GS/OS disk images even if present | ||||||
|  |                  provides error if a2setup doesn't have internet | ||||||
|  |                  remove persisting a2server-setup options after aborted install | ||||||
|  |                  fixed installer bug that omits first and last script elements | ||||||
|  |                  download images from Apple, with Internet Archive as a backup | ||||||
|  |                  install HFS.FST during netboot install | ||||||
|  |  | ||||||
|  | 1.2.5+:Nov 2015: Merged Ivan's 1.2.5 release, removed support for Ubuntu for | ||||||
|  | [unannounced]    now (see RasppleII/a2server#11), patched ProDOS 8 in boot | ||||||
|  |                  files for current year table, install unar from a package if | ||||||
|  |                  it exists. | ||||||
|  |  | ||||||
|  | 1.2.6: Nov 2015: full, ready to use install of Spectrum; install unzip | ||||||
|  | [unannounced] | ||||||
|  |                   | ||||||
|  | 1.2.6+:Nov 2015: merged Ivan's 1.2.6 (into github master branch) | ||||||
|  | [unannounced] | ||||||
|  |  | ||||||
|  | 1.2.7: Dec 2015: preliminary Jessie support; case insensitive file system for | ||||||
|  | [unannounced]    A2FILES; removes GSFILES if empty; DOS3.3.FST and TEACH are | ||||||
|  |                  installed with netboot installation; minor bug fixes and | ||||||
|  |                  tweaks; Ubuntu support removed; branches unified | ||||||
|  |  | ||||||
|  | 1.2.8: Dec 2015: can specify alternate host for binaries and external files; | ||||||
|  | [unannounced]    64-bit Debian precompiled binaries; move /media/A2SHARED/* | ||||||
|  |                  to /srv/A2SERVER; internet access (MacIP support); | ||||||
|  |                   | ||||||
|  | 1.2.9: Jan 2016: cppo supports ShrinkIt, DOS 3.3, DSK, 2MG; MountIt fully | ||||||
|  | [unannounced]    installed; nulib2 fixes handling empty forks (thanks Andy); | ||||||
|  |                  -c installer option compiles all software (no binaries) | ||||||
|  |                   | ||||||
|  | 1.3.0: Jan 2016: Marinetti 3.0b8 installed, with preconfigured MacIP | ||||||
|  | [unannounced] | ||||||
|  |  | ||||||
|  | 1.3.1: Jan 2016: patch Prodos 8 Thunderclock year table based on current date | ||||||
|  | [unannounced] | ||||||
|  |  | ||||||
|  | 1.3.2: Jan 2016: install SAFE2, SAM2, and SNAP, configured for Apple II sites; | ||||||
|  | [unannounced]    -i installer option reinstalls A2SERVER | ||||||
|  |                   | ||||||
|  | 1.5.0: Jan 2016: defaults to GitHub for location of installer scripts | ||||||
|  | [unannounced] | ||||||
|  |  | ||||||
|  | 1.5.1: May 2016: changed URLs from rawgit.com to raw.githubusercontent.com | ||||||
|  |                  to resolve https problems during install; OS X temp dir | ||||||
|  |                  path corrected; added getexternal.sh to repo; | ||||||
|  |                  cppo changes; minor text changes (JTC); better Debian | ||||||
|  |                  version checking (JTC) | ||||||
|  | [unannounced] | ||||||
|  |  | ||||||
|  | 1.5.1r2: Oct 2017: set internal version to 1.5.1; expanded version history | ||||||
|  | [unannounced] | ||||||
| @@ -4,7 +4,7 @@ | |||||||
| # 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" ;; | ||||||
| 	*) scriptURL="${A2SERVER_SCRIPT_URL:-http://ivanx.com/a2server}/" ;; | 	*) scriptURL="${A2SERVER_SCRIPT_URL:-https://raw.githubusercontent.com/RasppleII/a2server/current}/" ;; | ||||||
| esac | esac | ||||||
|  |  | ||||||
| currentVersion=$(wget -qO- "${scriptURL}setup/index.txt" | grep '^a2serverVersion' | cut -d '"' -f 2) | currentVersion=$(wget -qO- "${scriptURL}setup/index.txt" | grep '^a2serverVersion' | cut -d '"' -f 2) | ||||||
| @@ -37,9 +37,8 @@ else | |||||||
|     read |     read | ||||||
| fi | fi | ||||||
| if [[ ${REPLY:0:1} == "y" || ${REPLY:0:1} == "Y" ]]; then | 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 |     # sudo rm /usr/local/etc/netatalk/a2boot/* &> /dev/null | ||||||
|     wget -q -O /tmp/setup "${scriptURL}setup/index.txt"; source /tmp/setup "$@" |     wget -q -O /tmp/setup "${scriptURL}setup/index.txt"; source /tmp/setup -i "$@" | ||||||
| fi | fi | ||||||
|  |  | ||||||
| unset currentVersion 2> /dev/null | unset currentVersion 2> /dev/null | ||||||
|   | |||||||
| @@ -48,44 +48,33 @@ | |||||||
|  |  | ||||||
| 1.2.3: May 2015: changed Apple software links to Internet Archive | 1.2.3: May 2015: changed Apple software links to Internet Archive | ||||||
|  |  | ||||||
| 1.2.4: Jul 2015: offer to download A2CLOUD disk contents onto A2FILES volume | 1.2.4: Jul 2015: install option for ProTERM, Z.Link, ADTPro, Spectrum images | ||||||
|  |  | ||||||
| 1.2.4+:Oct 2015: support for using A2SERVER scripts from a location other than | 1.2.5: Nov 2015: netboot install option for GS/OS 6.0.2/3; install HFS.FST | ||||||
|                  ivanx.com/a2server for development purposes |                  during netboot install | ||||||
|                  [not released] |  | ||||||
|  |  | ||||||
| 1.2.5: Nov 2015: netboot install option for GS/OS 6.0.2/3 | 1.2.6: Nov 2015: full, ready to use install of Spectrum | ||||||
|                  netboot always downloads GS/OS disk images even if present |                  [unannounced; released briefly, then withdrawn] | ||||||
|                  provides error if a2setup doesn't have internet |  | ||||||
|                  remove persisting a2server-setup options after aborted install |  | ||||||
|                  fixed installer bug that omits first and last script elements |  | ||||||
|                  download images from Apple, with Internet Archive as a backup |  | ||||||
|                  install HFS.FST during netboot install |  | ||||||
|  |  | ||||||
| 1.2.5+:Nov 2015: Merged Ivan's 1.2.5 release, removed support for Ubuntu for | 1.5.0: Jan 2016: mixed case filenames for A2FILES; remove GSFILES if empty;  | ||||||
|                  now (see RasppleII/a2server#11), patched ProDOS 8 in boot |                  install Marinetti 3.0b8 with internet access via MacIP; | ||||||
|                  files for current year table, install unar from a package if |                  fully install Spectrum, SAFE2, SAM2, SNAP, MountIt; install | ||||||
|                  it exists. |                  DOS3.3 and TEACH; remove Ubuntu support; move/media/A2SHARED/* | ||||||
|                  [not released] |                  to /srv/A2SERVER; faster install (precompiled binaries) on | ||||||
|  |                  64-bit Debian; cppo supports ShrinkIt, DOS 3.3, DSK, 2MG,mixed | ||||||
|  |                  case filenames; nulib2 handles empty forks (thanks Andy); | ||||||
|  |                  new installer options; patch P8 Thunderclock driver year table | ||||||
|  |                  for current date; install from any host URL for development; | ||||||
|  |                  source code at GitHub (thanks Joseph) | ||||||
|  |  | ||||||
| 1.2.6: Nov 2015: full, ready to use install of Spectrum; install unzip | 1.5.1: Jan 2016: fixed GitHub URLs to prevent https errors during installation | ||||||
|                  [released briefly, then withdrawn] |                  (thanks to http://blogs.yahoo.co.jp/ushi_cow/57459736.html); | ||||||
|  |                  bug fixes and minor text changes | ||||||
|  |  | ||||||
| 1.2.6+:Nov 2015: merged Ivan's 1.2.6 | Big thanks to: Anthony Martino, Henry Courbis, Joseph Carter, Jason King, | ||||||
|                  [not released] | Andy McFadden, Steven Hirsch, Geoff Body, Peter Wong, Tony Diaz, David Schmidt, | ||||||
|  | David Schmenk, Ewen Wannop, Andrew Roughan, Antoine Vignau, Martin Haye, | ||||||
| 1.2.7: Dec 2015: codebase unified; preliminary Jessie support; case insensitive | Ken Gagne, Peter Neubauer, James Littlejohn, Ninjaforce; the creators of | ||||||
|                  file system for A2FILES; removes GSFILES if empty; DOS3.3.FST | Netatalk, The Unarchiver, ciopfs, macipgw; and the entire Apple II community. | ||||||
|                  and TEACH are installed with netboot installation; minor bug | Redistribution of Spectrum, SAFE2, SAM2, SNAP by permission of Ewen Wannop. | ||||||
|                  fixes and tweaks | Thanks for using A2SERVER! | ||||||
|                  [not released] |  | ||||||
|  |  | ||||||
| 1.2.8: Dec 2015: moved /media/A2SHARED to /srv/A2SERVER |  | ||||||
|                  macipgw installed |  | ||||||
|                  files subdirectory reorganized |  | ||||||
|                  64-bit Debian binaries |  | ||||||
|                  A2SERVER_SCRIPT_URL now works everywhere |  | ||||||
|                  A2SERVER_BINARY_URL can now be specified |  | ||||||
|                  self-hosted binaries fallback, or preferred with A2SERVER_NO_EXTERNAL |  | ||||||
|                  better information at start and end of install |  | ||||||
|                  [not released] |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user