From cf4bc9ea92654e6592a22e1dad105c49cf503cf2 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Fri, 30 Oct 2015 05:38:31 -0700 Subject: [PATCH] Remove trailing whitespace from lines --- setup/a2chat.txt | 2 +- setup/a2cloud-help.txt | 4 +- setup/a2news.txt | 6 +- setup/acmd.txt | 12 ++-- setup/adtpro-start.txt | 6 +- setup/adtpro.sh.txt | 8 +-- setup/cppo.txt | 12 ++-- setup/dopo.txt | 10 +-- setup/dos2pro.txt | 6 +- setup/gsport.txt | 12 ++-- setup/kegs.txt | 4 +- setup/linapple.txt | 4 +- setup/mkpo.txt | 16 ++--- setup/raspbian-update.txt | 6 +- setup/setup.txt | 132 +++++++++++++++++++------------------- setup/term.txt | 2 +- setup/usbgetty.txt | 2 +- 17 files changed, 122 insertions(+), 122 deletions(-) diff --git a/setup/a2chat.txt b/setup/a2chat.txt index 3cb3f80..79536dd 100644 --- a/setup/a2chat.txt +++ b/setup/a2chat.txt @@ -6,7 +6,7 @@ if [[ ! $(dpkg -l irssi 2> /dev/null | grep '^ii') ]]; then supo apt-get -y update sudo apt-get -y install irssi &> /dev/null sudo apt-get -y clean -fi +fi if [[ $1 == "-n" && $2 ]]; then nickname=$2 diff --git a/setup/a2cloud-help.txt b/setup/a2cloud-help.txt index b39ce76..0a83eae 100644 --- a/setup/a2cloud-help.txt +++ b/setup/a2cloud-help.txt @@ -21,7 +21,7 @@ showip : show the current ethernet IP address of the server showmac : show the MAC (Ethernet hardware) address of the server showip-wifi : show the current wifi IP address of the server showmac-wifi : show the MAC (wifi hardware) address of the server -ifreset : reset all network interfaces (requires restart) +ifreset : reset all network interfaces (requires restart) adtpro-stop : stop the ADTPro service adtpro-start : start the ADTPro service @@ -45,7 +45,7 @@ vsd2 : show or set the disk image assigned to virtual drive 2 forfloppy : move the disk image to the ADTPro disk images folder (/usr/local/adtpro/disks) in preparation for transfer vsdsync : update ADTPro server with the current virtual drive images - + nulib2 : create, extract, and work with NuFX (ShrinkIt) archive files sciibin : decode BinSCII file (they start with 'FiLeStArTfIlEsTaRt') unblu/usq/unbit/unexec : decode Binary II, Squeezed, Executioner, diff --git a/setup/a2news.txt b/setup/a2news.txt index a9aee6f..463ed32 100644 --- a/setup/a2news.txt +++ b/setup/a2news.txt @@ -9,7 +9,7 @@ if [[ ! $(dpkg -l tin 2> /dev/null | grep '^ii') ]]; then sudo apt-get -y update sudo apt-get -y install tin &> /dev/null sudo apt-get -y clean -fi +fi if [[ $1 == "-h" || $1 == "--help" ]]; then echo "Usage: a2news [-s nntpServerAddress] [-m postingEmailAddress] [otherTinOptions]" @@ -17,13 +17,13 @@ if [[ $1 == "-h" || $1 == "--help" ]]; then exit 1 fi -while [[ $1 == "-s" || $1 == "-m" ]]; do +while [[ $1 == "-s" || $1 == "-m" ]]; do if [[ $1 == "-s" && $2 ]]; then nntpServer=$2 shift shift fi - + if [[ $1 == "-m" && $2 ]]; then emailAddress=$2 shift diff --git a/setup/acmd.txt b/setup/acmd.txt index 0e0cd87..dfe66aa 100644 --- a/setup/acmd.txt +++ b/setup/acmd.txt @@ -94,7 +94,7 @@ if [[ ( $arg1 == "-p" || $arg1 == "-c" || $arg1 == "-g" || $arg1 == "-e" ) && $2 [[ ! $3 ]] && outFile="${2##*/}" java -Xmx128m -jar "$adtPath"/lib/AppleCommander/AppleCommander-ac.jar $getArg "$imageArg" "$fileArg" $outFile 2> $acmdStdErr else # put file - + # test ProDOS name legitimacy prodosPath=$(tr [:lower:] [:upper:] <<< $prodosArg ) IFS_orig="$IFS"; IFS="/"; @@ -105,11 +105,11 @@ if [[ ( $arg1 == "-p" || $arg1 == "-c" || $arg1 == "-g" || $arg1 == "-e" ) && $2 fi done IFS="$IFS_orig" - - # process filetype + + # process filetype [[ ${3:0:2} == "0x" ]] && ftArg="\$${3:2}" || ftArg="$3" auxType="$4" - + # assume BIN/$2000 if filetype omitted if [[ ! $ftArg ]]; then ft="BIN" @@ -130,7 +130,7 @@ if [[ ( $arg1 == "-p" || $arg1 == "-c" || $arg1 == "-g" || $arg1 == "-e" ) && $2 # set auxtype to $0801 for Applesoft programs if not specified [[ $ft == "BAS" && ! $auxType ]] && auxType="\$0801" - + # test for absence of stdin [[ -t 0 ]] and if absent use ProDOS name if [[ -t 0 ]]; then [[ ! -f $prodosArg ]] && { echoerr "$prodosArg not found."; exit 1; } @@ -141,7 +141,7 @@ if [[ ( $arg1 == "-p" || $arg1 == "-c" || $arg1 == "-g" || $arg1 == "-e" ) && $2 java -Xmx128m -jar "$adtPath"/lib/AppleCommander/AppleCommander-ac.jar -p "$imageArg" $prodosPath $ft $auxType 2> $acmdStdErr fi fi - + else imageArg="$2" diff --git a/setup/adtpro-start.txt b/setup/adtpro-start.txt index 04286a0..617b574 100644 --- a/setup/adtpro-start.txt +++ b/setup/adtpro-start.txt @@ -3,9 +3,9 @@ # don't do anything if ADTPro is already running if [[ $(ps aux | grep [A]DTPro) ]]; then - + 1&>2 echo "ADTPro server is already running." - + else # look for eligible USB-to-serial adapter @@ -20,7 +20,7 @@ else elif [[ $(ls -1 /dev/ttyUSBupper_hub* 2> /dev/null | wc -l) -gt 1 ]]; then ttyUSB=$(ls -1 /dev/ttyUSBupper_hub* 2> /dev/null | head -1 | cut -c 6-) fi - + if [[ $ttyUSB ]]; then echo -n "Please wait..." sudo nohup adtpro.sh headless serial &> /dev/null diff --git a/setup/adtpro.sh.txt b/setup/adtpro.sh.txt index fa29a6d..0b35946 100644 --- a/setup/adtpro.sh.txt +++ b/setup/adtpro.sh.txt @@ -54,7 +54,7 @@ if [ "$OS" = "Linux" ]; then if [[ ! -c /dev/$serialPortName ]]; then echo "Serial port $serialPortName not found." 1>&2 usageExit - fi + fi elif [[ -c /dev/ttyUSBlower ]]; then serialPortName=ttyUSBlower elif [[ $(ls -1 /dev/ttyUSBlower_hub* 2> /dev/null | wc -l) -gt 0 ]]; then @@ -68,9 +68,9 @@ if [ "$OS" = "Linux" ]; then echo " any port on lower USB hub with no other adapters" echo " lowest port on USB hub on upper or lower USB port with multiple adapters" usageExit - fi + fi fi - + if [[ $(grep CommPort= /usr/local/adtpro/disks/ADTPro.properties) ]]; then if [[ $serialPortName ]]; then sed -i "s/^CommPort=.*$/CommPort=\/dev\/$serialPortName/" /usr/local/adtpro/disks/ADTPro.properties &> /dev/null @@ -83,7 +83,7 @@ if [ "$OS" = "Linux" ]; then fi ADTPRO_EXTRA_JAVA_PARMS="-Dgnu.io.rxtx.SerialPorts=/dev/$serialPortName" - + if [ -f /usr/bin/raspi-config ]; then export RXTXLIB=lib/rxtx/rxtx-2.2pre2-local/arm elif [ "$OS_ARCH" = "i686" ]; then diff --git a/setup/cppo.txt b/setup/cppo.txt index d268c1c..0e93f1b 100644 --- a/setup/cppo.txt +++ b/setup/cppo.txt @@ -134,7 +134,7 @@ def getFileName(arg1, arg2): def getFileType(arg1, arg2): start = getStartPos(arg1, arg2) return readcharHex(g.imageData, start+16) - + def getKeyPointer(arg1, arg2): start = getStartPos(arg1, arg2) return (readcharDec(g.imageData, start+17) + @@ -366,7 +366,7 @@ def processEntry(arg1, arg2): if g.PDOSPATH_SEGMENT: syncExit() g.targetName = None - + #else: #print(g.activeFileName + " doesn't match " + g.PDOSPATH_SEGMENT) @@ -507,7 +507,7 @@ def binToDec(arg1): # arg: binary string up to 8 bits # out: decimal value return to_dec([arg1]) - + def binToHex(arg1): # converts single-byte binary string (8 bits) value to hex # warning: no error checking @@ -701,10 +701,10 @@ def to_bytes(val): else: raise Exception( "to_bytes() requires hex-ustr, int/long, or [bin-ustr]") - + def shift(items): """Shift list items to left, losing the first item. - + in : list out: list """ @@ -712,7 +712,7 @@ def shift(items): items[i] = items[i+1] del items[-1] return items - + def s(string): """Perform local variable substution, e.g. 'total: {num} items'""" # http://stackoverflow.com/questions/2960772/ diff --git a/setup/dopo.txt b/setup/dopo.txt index 8a28040..17b2c87 100644 --- a/setup/dopo.txt +++ b/setup/dopo.txt @@ -10,7 +10,7 @@ if [[ "$1" == "-c" ]]; then stdout=1; else stdout= -fi +fi # use stdin? if [[ ! $1 || "$1" == "-" ]]; then @@ -26,13 +26,13 @@ fi if [[ ! $stdout ]]; then #get filename extension, in lowercase f="$(tr [:upper:] [:lower:] <<< ${1##*.})"; - + #if it's dsk/do/po, get name without extension [[ "$f" == "dsk" || "$f" == "do" || "$f" == "po" ]] && of="${1%.*}" || of="$1"; - + #if name had .po extension, append .dsk to outfile name, otherwise append .po [[ "$f" == "po" ]] && of="$of.dsk" || of="$of.po" - + # set outfile param for dd ofile="$of" else @@ -44,7 +44,7 @@ if [[ ! $stdin ]]; then ifile="$1" elif [[ -t 0 ]]; then echo "usage: dopo [-c] [-|140KdiskImageFilename]" 1>&2; exit 1; -else +else ifile="/tmp/$$.dopo_in" cat > "$ifile" fi diff --git a/setup/dos2pro.txt b/setup/dos2pro.txt index 9c50f19..6a781ba 100644 --- a/setup/dos2pro.txt +++ b/setup/dos2pro.txt @@ -82,7 +82,7 @@ while read thisLine; do if [[ ${thisLine:0:2} == "* " || ${thisLine:0:2} == " " ]]; then dosName=$(cut -c 5- <<< $thisLine | rev | sed 's/^[^ ]* [^ ]* [^ ]* [^ ]* [^ ]* \(.*$\)/\1/' | rev) if [[ ! $fileName || "$fileName" == "$dosName" ]]; then - + dosType=$(cut -c 3 <<< $thisLine) if [[ $dosType == "A" ]]; then proType="BAS" @@ -104,9 +104,9 @@ while read thisLine; do echo "Error: Unknown DOS 3.3 file type." exit 2 fi - + proName=$(sed 's/^[^A-Za-z]/A/' <<< $dosName | sed 's/[^A-Za-z0-9\.]/./g') - + auxType= [[ $binAddr ]] && auxType="\$$binAddr" echo "Copying '$dosName' to '$proName'" diff --git a/setup/gsport.txt b/setup/gsport.txt index 1724604..9016366 100644 --- a/setup/gsport.txt +++ b/setup/gsport.txt @@ -11,14 +11,14 @@ else echo "snd-pcm-oss" | sudo tee -a /etc/modules > /dev/null [[ ! $(lsmod | grep snd_pcm_oss) ]] && sudo modprobe snd-pcm-oss fi - + if [[ ! $(dpkg -l xfonts-base 2> /dev/null | grep '^ii') ]]; then echo "Configuring GSport fonts..." sudo apt-get -y update touch /tmp/updated sudo apt-get -y install xfonts-base &> /dev/null sudo apt-get -y clean - fi + fi if [[ ! $(dpkg -l libpcap0.8-dev 2> /dev/null | grep '^ii') ]]; then echo "Configuring GSport networking..." @@ -26,13 +26,13 @@ else sudo apt-get -y install libpcap0.8-dev &> /dev/null sudo apt-get -y clean fi - + rm /tmp/updated &> /dev/null else gsport-setup [[ $? -ne 0 ]] && exit 1 fi - + displayOK= if [[ $DISPLAY ]]; then # X Window displayOK=1 @@ -82,7 +82,7 @@ else # touch /tmp/gsport-consolesetup # fi fi - + if [[ ! $(grep 'input' <<< $(groups) ) ]]; then sudo groupadd input &> /dev/null sudo usermod -a -G input $USER @@ -105,7 +105,7 @@ else fi fi fi - + if [[ ! $DISPLAY && -f /tmp/gsport-consolesetup ]]; then echo "GSport will be ready for console use after you restart your system." echo "You can restart now by typing 'system-restart'." diff --git a/setup/kegs.txt b/setup/kegs.txt index 4c240a0..42af2af 100644 --- a/setup/kegs.txt +++ b/setup/kegs.txt @@ -11,13 +11,13 @@ else echo "snd-pcm-oss" | sudo tee -a /etc/modules > /dev/null [[ ! $(lsmod | grep snd_pcm_oss) ]] && sudo modprobe snd-pcm-oss fi - + if [[ ! $(dpkg -l xfonts-base 2> /dev/null | grep '^ii') ]]; then echo "Configuring KEGS fonts..." sudo apt-get -y update sudo apt-get -y install xfonts-base &> /dev/null sudo apt-get -y clean - fi + fi exec xkegs else diff --git a/setup/linapple.txt b/setup/linapple.txt index b344523..8e7cd28 100644 --- a/setup/linapple.txt +++ b/setup/linapple.txt @@ -22,7 +22,7 @@ else echo 'SUBSYSTEM=="input", GROUP="input", MODE="0660"' | sudo tee /etc/udev/rules.d/99-input.rules > /dev/null touch /tmp/linapple-consolesetup fi - + if [[ -c /dev/fb0 ]]; then [[ ! -f /tmp/linapple-consolesetup ]] && linappleOk=1 else @@ -38,7 +38,7 @@ else fi fi fi - + if [[ ! $DISPLAY && -f /tmp/linapple-consolesetup ]]; then echo "LinApple will be ready for console use after you restart your system." echo "You can restart now by typing 'system-restart'." diff --git a/setup/mkpo.txt b/setup/mkpo.txt index 99243b5..d25971b 100644 --- a/setup/mkpo.txt +++ b/setup/mkpo.txt @@ -3,8 +3,8 @@ # ID-bashByter routines -function binToDec () -{ +function binToDec () +{ dec=0; bits=$1; while (( ${#bits} < 8 )); do @@ -17,8 +17,8 @@ function binToDec () echo -n $dec }; -function writecharDec () -{ +function writecharDec () +{ [[ -n $1 ]] || return 11; [[ -n $2 ]] || return 12; [[ -n $3 ]] || return 13; @@ -28,8 +28,8 @@ function writecharDec () echo -n -e "\x$(printf %02X "$3")" | dd of="$1" bs=1 seek=$(($2)) conv=notrunc 2> /dev/null }; -function writecharsHex () -{ +function writecharsHex () +{ [[ -n $1 ]] || return 11; [[ -n $2 ]] || return 12; [[ -n $3 ]] || return 13; @@ -115,7 +115,7 @@ if [[ ! $totalBlocks && $(tr [:upper:] [:lower:] <<< "${1##*.}") == "dsk" ]]; th for s in 0 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15; do dd bs=256 count=1 if="$1".tmp of="$1" skip=$(( $t*16 + $s )) seek=$(( $t*16 + ( $s==0||$s==15 ? $s : 15-$s ) )) 2> /dev/null; done; - done + done rm "$1".tmp fi @@ -146,7 +146,7 @@ if [[ ! $nulib2 && $totalBlocks ]]; then dd if=/dev/zero of="$1" bs=1 seek=3072 count=$(( (fsbExtraBlocks > 8) + 1 )) conv=notrunc 2> /dev/null; (( fsbExtraBlocks-- )); fi; - + bits=$(( fsbExtraBlocks % 8 )); if (( bits > 0 )); then freeString="11111111"; diff --git a/setup/raspbian-update.txt b/setup/raspbian-update.txt index 2257812..9b1be12 100644 --- a/setup/raspbian-update.txt +++ b/setup/raspbian-update.txt @@ -49,7 +49,7 @@ if [[ \ ${partitions[1]:0:14} == "/dev/mmcblk0p2" && ${partitions[1]:57:2} == "85" && ${partitions[2]:0:14} == "/dev/mmcblk0p3" && ${partitions[2]:57:2} == "83" && ${partitions[3]:0:14} == "/dev/mmcblk0p5" && ${partitions[3]:57:2} == " c" && - ${partitions[4]:0:14} == "/dev/mmcblk0p6" && ${partitions[4]:57:2} == "83" ]]; then + ${partitions[4]:0:14} == "/dev/mmcblk0p6" && ${partitions[4]:57:2} == "83" ]]; then noobs=" and the NOOBS install manager" fi @@ -83,7 +83,7 @@ if [[ ! $noobsOnly ]]; then { cd /tmp; sudo apt-get -y autoremove; sudo apt-get -y autoclean; sudo apt-get -y clean; } > /dev/null freeSpace=$(df / | tail -1 | awk '{ print $4 }') if (( $freeSpace < 400000 )); then - if dpkg -l | grep -q wolfram-engine; then + if dpkg -l | grep -q wolfram-engine; then if [[ ! $autoYes ]]; then echo "In order to create enough space on your SD card to upgrade," echo "the Wolfram Language and Mathematica software packages must be removed." @@ -180,7 +180,7 @@ if [[ $noobs ]]; then grep -q 'disablesafemode' /tmp/p1/recovery.cmdline || sudo sed -i '1 s/^\(.*\)$/\1 disablesafemode/' /tmp/p1/recovery.cmdline sudo umount /tmp/p1 rmdir /tmp/p1 - + sudo sed -i 's/\(Raspple II release.*[^u]$\)/\1u/' /etc/issue fi diff --git a/setup/setup.txt b/setup/setup.txt index cac1a6e..4482efe 100644 --- a/setup/setup.txt +++ b/setup/setup.txt @@ -210,13 +210,13 @@ else echo -n "? " read [[ ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]] && installADTPro=1 - + createBootDisk= installArchiveTools= newImageName= imageSize= if [[ $installADTPro ]]; then - + echo echo -n "Do you want to create A2CLOUD 140K and 800K boot disk images? " read @@ -224,7 +224,7 @@ else createBootDisk=1 installArchiveTools=1 fi - + if [[ ! -f /usr/local/adtpro/disks/Virtual.po || ( -f /usr/local/adtpro/adtpro.sh && -f /usr/local/adtpro/disks/Virtual.po && $(sha1sum /usr/local/adtpro/disks/Virtual.po | cut -f 1 -d ' ') == "a209a8b3a485c95c57bc691a8a58867a6c0ec628" ) ]]; then while (( 1 )); do echo @@ -259,32 +259,32 @@ else done fi fi - + setupSerialPortLogin= echo echo -n "Do you want to set up your $me for serial port login? " read [[ ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]] && setupSerialPortLogin=1 - + installCommTools= echo echo -n "Install internet access and file transfer tools on your $me? " read [[ ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]] && installCommTools=1 - + if [[ ! $installArchiveTools ]]; then echo echo -n "Install utilities for Apple II archives and disk images? " read [[ ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]] && installArchiveTools=1 fi - + installEmulators= echo echo -n "Install Apple IIgs and IIe emulators? " read [[ ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]] && installEmulators=1 - + installA2Pi= if [[ $isRpi ]]; then echo @@ -293,7 +293,7 @@ else [[ ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]] && installA2Pi=1 fi fi - + echo userPw=$(sudo grep "^$USER" /etc/shadow | cut -f 2 -d ':') [[ $userPw == "$(echo 'apple2' | perl -e '$_ = ; chomp; print crypt($_, $ARGV[0])' "${userPw%"${userPw#\$*\$*\$}"}")" ]] && isApple2Pw=1 || isApple2Pw= @@ -404,7 +404,7 @@ else fi if [[ $installADTPro ]]; then - + freeSpace=$(df / | tail -1 | awk '{ print $4 }') java -version &> /dev/null if (( $? == 127 && $freeSpace < 350000 )); then @@ -421,7 +421,7 @@ if [[ $installADTPro ]]; then echo [[ $0 == "-bash" ]] && return 3 || exit 3 fi - + if [[ ! -f /usr/bin/X ]]; then echo "A2CLOUD: Installing X Window System and LXDE..." sudo apt-get -y install xorg lxde @@ -432,7 +432,7 @@ if [[ $installADTPro ]]; then else echo "A2CLOUD: X Window System and LXDE are already installed." fi - + # if [[ ! -f /etc/xdg/autostart/lxterminal.desktop ]]; then # echo "A2CLOUD: Setting terminal window to auto-open on desktop..." # echo -e "\n[Desktop Entry]\nType=Application\nExec=/usr/bin/lxterminal" | sudo tee /etc/xdg/autostart/lxterminal.desktop > /dev/null @@ -460,7 +460,7 @@ if [[ $installADTPro ]]; then sudo sed -i 's/^.*VBOX0.*$//' /etc/xdg/lxsession/LXDE/autostart 2> /dev/null sudo sed -i 's/^.*VBOX0.*$//' /etc/xdg/lxsession/LXDE-pi/autostart 2> /dev/null fi - + # install or update java javaVersion=$(java -version 2>&1) if [[ ( $? -eq 127 ) || ( $(head -1 <<< "$javaVersion" | cut -f 2 -d '.') -lt 8 ) ]]; then @@ -492,7 +492,7 @@ if [[ $installADTPro ]]; then else echo "A2CLOUD: Java is already installed." fi - + updateADTPro= # check if update needed if [ -f /usr/local/adtpro/lib/ADTPro-* ]; then @@ -527,7 +527,7 @@ if [[ $installADTPro ]]; then echo "A2CLOUD: ADTPro server does not need updating." fi fi - + if [[ ! -f /usr/local/adtpro/adtpro.sh || ! -f /usr/local/adtpro/ADTPro.html ]]; then echo "A2CLOUD: installing ADTPro server..." sudo pkill -f [A]DTPro @@ -554,7 +554,7 @@ if [[ $installADTPro ]]; then else echo "A2CLOUD: AppleCommander-1.3.5.13id is already installed." fi - + echo "A2CLOUD: Setting up customized adtpro.sh..." wget -qO /usr/local/adtpro/adtpro.sh ivanx.com/a2cloud/setup/adtpro.sh.txt sudo chmod ugo+rwx /usr/local/adtpro/adtpro.sh @@ -564,7 +564,7 @@ if [[ $installADTPro ]]; then sudo mv /tmp/a2cloud-install/disks/* /usr/local/adtpro/disks sudo rmdir /tmp/a2cloud-install/disks fi - + if [[ ! -f /usr/lib/jni/librxtxSerial.so ]]; then echo "A2CLOUD: Installing serial port libraries..." sudo apt-get -y install librxtx-java @@ -574,7 +574,7 @@ if [[ $installADTPro ]]; then fi [[ ! -f /usr/lib/RXTXcomm.jar ]] && sudo ln -s /usr/share/java/RXTXcomm.jar /usr/lib &> /dev/null [[ ! -d /usr/local/adtpro/lib/rxtx/rxtx-2.2pre2-local/arm ]] && ln -s /usr/lib/jni /usr/local/adtpro/lib/rxtx/rxtx-2.2pre2-local/arm &> /dev/null - + if [[ ! -f /usr/bin/xvfb-run ]]; then echo "A2CLOUD: Installing xvfb for headless operation..."cd sudo apt-get -y install xvfb @@ -582,7 +582,7 @@ if [[ $installADTPro ]]; then else echo "A2CLOUD: xvfb is already installed." fi - + if [[ -f /usr/local/sbin/afpd ]]; then # A2SERVER/netatalk installed if [[ ! -d /media/A2SHARED/ADTDISKS || ! $(grep ADTDISKS /usr/local/etc/netatalk/AppleVolumes.default) ]]; then echo "A2CLOUD: Setting up /usr/local/adtpro/disks for Apple file sharing..." @@ -596,7 +596,7 @@ if [[ $installADTPro ]]; then else echo "A2CLOUD: /usr/local/adtpro/disks is already set up for Apple file sharing." fi - + if { grep -q A2SHARED /etc/samba/smb.conf 2> /dev/null; }; then # SMB already enabled by A2SERVER if { grep -q ADTDISKS /etc/samba/smb.conf 2>/dev/null; }; then @@ -651,7 +651,7 @@ else fi if [[ $setupSerialPortLogin ]]; then - + echo "A2CLOUD: Setting GPIO serial login to 4800 bps, and disabling..." # set console port login to 4800 bps (using RPi console cable) and comment it out sudo sed -i 's/^\(T.*\)ttyAMA0 .* /#\1ttyAMA0 4800 /' /etc/inittab @@ -691,7 +691,7 @@ if [[ $setupSerialPortLogin ]]; then else echo "A2CLOUD: Serial port login is already using 8-bit character set." fi - + echo "A2CLOUD: Setting up baud command..." sudo wget -qO /usr/local/bin/baud ${scriptURL}setup/baud.txt sudo chmod ugo+x /usr/local/bin/baud @@ -703,7 +703,7 @@ if [[ $setupSerialPortLogin ]]; then echo "A2CLOUD: Setting up usbgetty command..." sudo wget -qO /usr/local/sbin/usbgetty ${scriptURL}setup/usbgetty.txt sudo chmod ugo+x /usr/local/sbin/usbgetty - + echo "A2CLOUD: Removing ttyUSB0 shell login..." sudo sed -i "s/^\([^#].*ttyUSB0.*\)$//" /etc/inittab @@ -714,7 +714,7 @@ if [[ $setupSerialPortLogin ]]; then sudo pkill -f "[g]etty.*ttyUSB" else echo "A2CLOUD: USB port shell login already added." - fi + fi fi @@ -726,7 +726,7 @@ if [[ ! -f /etc/udev/rules.d/50-usb.rules ]]; then echo "A2CLOUD: Creating device rules for USB ports..." udevLines= if [[ $isRpi ]]; then - # assign ttyUSBupper, or ttyUSBupper_hubXX, for shell usb-to-serial adapter + # assign ttyUSBupper, or ttyUSBupper_hubXX, for shell usb-to-serial adapter # assign ttyUSBlower, or ttyUSBlower_hubXX, for ADTPro usb-to-serial adapter # (A/A+ direct attach is always ttyUSBlower; # hub attached to A/A+ will be ttyUSBupper on port 2, and ttyUSBlower on port 3) @@ -761,7 +761,7 @@ if [[ $installCommTools ]]; then if [[ ! -f /usr/bin/curl ]]; then echo "A2CLOUD: Installing curl..." sudo apt-get -y install curl - sudo apt-get -y clean + sudo apt-get -y clean else echo "A2CLOUD: curl is already installed." fi @@ -773,7 +773,7 @@ if [[ $installCommTools ]]; then else echo "A2CLOUD: rzsz is already installed." fi - + if [[ ! -f /usr/bin/ftp ]]; then echo "A2CLOUD: Installing ftp..." sudo apt-get -y install ftp @@ -781,7 +781,7 @@ if [[ $installCommTools ]]; then else echo "A2CLOUD: ftp is already installed." fi - + if [[ ! -f /usr/local/bin/cftp ]]; then echo "A2CLOUD: Installing cftp..." cd /tmp/a2cloud-install @@ -811,7 +811,7 @@ if [[ $installCommTools ]]; then else echo "A2CLOUD: cftp is already installed." fi - + if [[ ! -f /usr/bin/lynx ]]; then echo "A2CLOUD: Installing lynx..." sudo apt-get -y install lynx @@ -874,7 +874,7 @@ if [[ $installCommTools ]]; then if [[ ( ! -f /usr/bin/ttytter && ! -f /usr/local/bin/ttytter ) || ! -f "/usr/local/share/perl/5.14.2/Term/ReadLine/TTYtter.pm" ]]; then echo "A2CLOUD: Installing TTYtter..." sudo wget -qO /usr/local/bin/ttytter http://www.floodgap.com/software/ttytter/dist2/2.1.00.txt - sudo chmod ugo+x /usr/local/bin/ttytter + sudo chmod ugo+x /usr/local/bin/ttytter perlVersion=$(perl -e 'print $^V' | cut -c 2-) if [[ ! -f "/usr/local/share/perl/$perlVersion/Term/ReadLine/TTYtter.pm" ]]; then echo "A2CLOUD: Installing TTYtter readline module..." @@ -923,7 +923,7 @@ if [[ $installA2Pi ]]; then echo "deb http://schmenk.is-a-geek.com/raspbian wheezy contrib" | sudo tee -a /etc/apt/sources.list > /dev/null sudo apt-get -y update > /dev/null fi - sudo apt-get -y --force-yes install a2pi + sudo apt-get -y --force-yes install a2pi sudo apt-get -y clean else echo "A2CLOUD: Apple II Pi is already installed." @@ -954,7 +954,7 @@ if [[ $installA2Pi ]]; then wget -qO- ivanx.com/a2cloud/files/slot6-gsport-rpi.tgz | sudo tar Pzx 2> /dev/null fi fi - + # set AppleTalk to turbo if ! grep -q 'g_appletalk_turbo' /usr/share/gsport/config.txt; then if grep -q 'bram1[00]' /usr/share/gsport/config.txt; then @@ -963,7 +963,7 @@ if [[ $installA2Pi ]]; then echo -e '\ng_appletalk_turbo = 1' | sudo tee -a /usr/share/gsport/config.txt > /dev/null fi fi - sudo sed -i 's/^g_appletalk_turbo = 0/g_appletalk_turbo = 1/' /usr/share/gsport/config.txt + sudo sed -i 's/^g_appletalk_turbo = 0/g_appletalk_turbo = 1/' /usr/share/gsport/config.txt # enable Uthernet if ! grep -q 'g_ethernet[^_]' /usr/share/gsport/config.txt; then @@ -973,12 +973,12 @@ if [[ $installA2Pi ]]; then echo -e '\ng_ethernet = 1' | sudo tee -a /usr/share/gsport/config.txt > /dev/null fi fi - sudo sed -i 's/^g_ethernet = 0/g_ethernet = 1/' /usr/share/gsport/config.txt + sudo sed -i 's/^g_ethernet = 0/g_ethernet = 1/' /usr/share/gsport/config.txt fi if [[ $installEmulators ]]; then - + # KEGS if [[ ! -f /usr/local/bin/xkegs ]]; then echo "A2CLOUD: Installing KEGS..." @@ -1037,7 +1037,7 @@ if [[ $installEmulators ]]; then sudo wget -qO /usr/local/bin/kegs-setup ${scriptURL}setup/kegs-setup-shell.txt sudo chmod ugo+x /usr/local/bin/kegs-setup - + # GSport, if non-RPi if [[ ! $isRpi && ! -f /usr/local/bin/gsport ]]; then echo "A2CLOUD: Installing GSport..." @@ -1081,7 +1081,7 @@ if [[ $installEmulators ]]; then if [[ $slot6 ]]; then echo "A2CLOUD: Putting blank disks in GSport slot 6..." - sudo sed -i 's@^s6d1.*$@s6d1 = /usr/local/share/gsdisks/slot6drive1.po@' /usr/local/lib/config.txt + sudo sed -i 's@^s6d1.*$@s6d1 = /usr/local/share/gsdisks/slot6drive1.po@' /usr/local/lib/config.txt sudo sed -i 's@^s6d2.*$@s6d2 = /usr/local/share/gsdisks/slot6drive2.po@' /usr/local/lib/config.txt if [[ ! -f /usr/local/share/gsdisks/slot6drive1.po || ! -f /usr/local/share/gsdisks/slot6drive2.po ]]; then wget -qO- http://appleii.ivanx.com/a2cloud/files/slot6.tgz | sudo tar Pzx 2> /dev/null @@ -1170,7 +1170,7 @@ fi if [[ $installArchiveTools ]]; then if [[ ! -f /usr/local/bin/nulib2 || ! -f /usr/local/bin/sciibin || ! -f /usr/local/bin/usq ]]; then - + echo "A2CLOUD: Installing nulib2, sciibin, unblu, unbit, unexec, usq..." cd /tmp/a2cloud-install @@ -1214,7 +1214,7 @@ if [[ $installArchiveTools ]]; then wget -q http://web.archive.org/web/20110619163030/http://fadden.com/dl-apple2/undoit.zip unzip undoit.zip make - sudo mv sciibin unbit unblu unexec usq /usr/local/bin + sudo mv sciibin unbit unblu unexec usq /usr/local/bin cd /tmp/a2cloud-install rm -rf undoit fi @@ -1269,7 +1269,7 @@ fi # add shortcuts to LXDE desktop and menu if [[ -f /usr/bin/X ]]; then - + [[ -d /etc/xdg/lxsession/LXDE-pi ]] && lxde="lxde-pi" || lxde="lxde" echo "A2CLOUD: Creating LXDE desktop and menu shortcuts..." @@ -1300,7 +1300,7 @@ if [[ -f /usr/bin/X ]]; then fi if [[ ! -f /usr/local/share/gsport32.ico ]]; then sudo wget -qO /usr/local/share/gsport32.ico http://appleii.ivanx.com/a2cloud/files/gsport32.ico - fi + fi # KEGS: if [[ -f /usr/local/bin/kegs ]]; then echo -e "[Desktop Entry]\nName=KEGS\nComment=Apple IIgs Emulator\nExec=lxterminal -e /usr/local/bin/kegs\nIcon=/usr/local/share/kegsicon.png\nTerminal=false\nType=Application\nCategories=AppleII\n" | sudo tee /usr/local/share/applications/kegs.desktop > /dev/null @@ -1308,7 +1308,7 @@ if [[ -f /usr/bin/X ]]; then fi if [[ ! -f /usr/local/share/kegsicon.png ]]; then sudo wget -qO /usr/local/share/kegsicon.png http://appleii.ivanx.com/a2cloud/files/kegsicon.png - fi + fi # LinApple: if [[ -f /usr/local/bin/linapple ]]; then echo -e "[Desktop Entry]\nName=LinApple\nComment=Apple IIe Emulator\nExec=lxterminal -e /usr/local/bin/linapple\nIcon=/usr/local/linapple/icon.bmp\nTerminal=false\nType=Application\nCategories=AppleII\n" | sudo tee /usr/local/share/applications/linapple.desktop > ~/Desktop/linapple.desktop @@ -1394,7 +1394,7 @@ if [[ $a2CloudDisk ]]; then # build if we don't have a disk image # (because download failed or -b argument was used) if [[ ! -f $a2CloudDisk || ( $(wc -c $a2CloudDisk | cut -f 1 -d ' ') != "819200" ) ]]; then - + # start with a disk image echo "A2CLOUD: Creating 800K disk image..." cp /usr/local/adtpro/disks/ADTPRO-*PO $a2CloudDisk @@ -1402,7 +1402,7 @@ if [[ $a2CloudDisk ]]; then # ADTPro echo "A2CLOUD: Preparing ADTPro..." - + acmd -d "$a2CloudDisk" BASIC acmd -d "$a2CloudDisk" STARTUP.SYSTEM acmd -d "$a2CloudDisk" ADTPRO @@ -1413,12 +1413,12 @@ if [[ $a2CloudDisk ]]; then acmd -g SystemTools1.dc42 BASIC.SYSTEM - | acmd -p "$a2CloudDisk" BASIC.SYSTEM SYS # use our startup program wget -qO- http://appleii.ivanx.com/a2cloud/files/STARTUP.BAS | acmd -p "$a2CloudDisk" STARTUP BAS - + # VEDRIVE echo "A2CLOUD: Copying VEDRIVE..." acmd -g /usr/local/adtpro/disks/VDRIVE-*DSK VEDRIVE - | acmd -p "$a2CloudDisk" VEDRIVE SYS acmd -g /usr/local/adtpro/disks/VDRIVE-*DSK VEDRIVE.CONFIG - | acmd -p "$a2CloudDisk" VEDRIVE.CONFIG BAS - + # Apple System Utilities 3.1 support files if [[ -f /usr/local/bin/unar ]]; then echo "A2CLOUD: Downloading and copying System Utilities support files..." @@ -1432,7 +1432,7 @@ if [[ $a2CloudDisk ]]; then else echo "A2CLOUD: unar is not available; not installing System Utilities support files." fi - + # ProTERM echo "A2CLOUD: Downloading ProTERM..." wget --user-agent="Mozilla/5.0 (wget_A2CLOUD; rv:1.13.4) Gecko/20100101 Firefox/4.0.1" -qO /tmp/a2cloud-install/pt31.shk http://lostclassics.apple2.info/download/InTrec/PT31A2GM2K9.SHK @@ -1462,30 +1462,30 @@ if [[ $a2CloudDisk ]]; then acmd -p "$a2CloudDisk" PROTERM SYS < /tmp/a2cloud-install/pt31/"PT3.SYSTEM#ff2000" cd /tmp/a2cloud-install rm -rf /tmp/a2cloud-install/pt31 - + # Z-Link echo "A2CLOUD: Downloading and copying Z-Link..." cd /tmp/a2cloud-install wget -qO /tmp/a2cloud-install/zlink.shk "ftp://ftp.gno.org/pub/apple2/prodos/comm/term/zLink91.shk" nulib2 -p zlink.shk z.link.system | acmd -p "$a2CloudDisk" Z.LINK SYS - - # ShrinkIt + + # ShrinkIt echo "A2CLOUD: Downloading and copying ShrinkIt..." cd /tmp/a2cloud-install wget -qO shrinkit.sdk http://web.archive.org/web/20131031160750/http://www.nulib.com/library/shrinkit.sdk [[ ! -f shrinkit.sdk ]] && wget -qO shrinkit.sdk http://appleii.ivanx.com/a2cloud/files/shrinkit.sdk nulib2 -xs shrinkit.sdk > /dev/null - acmd -g /tmp/a2cloud-install/SHRINKIT SHRINKIT - | acmd -p "$a2CloudDisk" SHRINKIT SYS - acmd -g /tmp/a2cloud-install/SHRINKIT SHRINKIT.SYSTEM - | acmd -p "$a2CloudDisk" SHRINKIT.SYS SYS - acmd -g /tmp/a2cloud-install/SHRINKIT IIPLUS.SHRINKIT - | acmd -p "$a2CloudDisk" IIPLUS.SHRINKIT SYS - acmd -g /tmp/a2cloud-install/SHRINKIT IIPLUS.UNSHRINK - | acmd -p "$a2CloudDisk" IIPLUS.UNSHRINK SYS - + acmd -g /tmp/a2cloud-install/SHRINKIT SHRINKIT - | acmd -p "$a2CloudDisk" SHRINKIT SYS + acmd -g /tmp/a2cloud-install/SHRINKIT SHRINKIT.SYSTEM - | acmd -p "$a2CloudDisk" SHRINKIT.SYS SYS + acmd -g /tmp/a2cloud-install/SHRINKIT IIPLUS.SHRINKIT - | acmd -p "$a2CloudDisk" IIPLUS.SHRINKIT SYS + acmd -g /tmp/a2cloud-install/SHRINKIT IIPLUS.UNSHRINK - | acmd -p "$a2CloudDisk" IIPLUS.UNSHRINK SYS + # DSK2FILE echo "A2CLOUD: Downloading and copying DSK2FILE..." cd /tmp/a2cloud-install wget -q -O dsk2file.shk http://www.dwheeler.com/6502/oneelkruns/dsk2file.zip nulib2 -p dsk2file.shk dsk2file58 | acmd -p "$a2CloudDisk" DSK2FILE SYS - + # Apple System Utilities 3.1 launch file if [[ -f /usr/local/bin/unar ]]; then echo "A2CLOUD: Copying System Utilities launch file..." @@ -1493,18 +1493,18 @@ if [[ $a2CloudDisk ]]; then else echo "A2CLOUD: unar is not available; not installing System Utilities." fi - + # Filer echo "A2CLOUD: Downloading and copying Filer..." wget -qO /tmp/a2cloud-install/mmgr.prutil.sdk ftp://ftp.gno.org/pub/apple2/prodos/comm/term/modem.mgr/mmgr.prutil.sdk cd /tmp/a2cloud-install nulib2 -xs mmgr.prutil.sdk > /dev/null - acmd -g /tmp/a2cloud-install/MMGR FILER - | acmd -p "$a2CloudDisk" FILER SYS - + acmd -g /tmp/a2cloud-install/MMGR FILER - | acmd -p "$a2CloudDisk" FILER SYS + # ADTPRO launch echo "A2CLOUD: Copying ADTPro launch file..." acmd -g /usr/local/adtpro/disks/ADTPRO-*DSK ADTPRO - | acmd -p "$a2CloudDisk" ADTPRO SYS - + # VSDRIVE if [[ ! $(acmd -ls "$a2CloudDisk" | grep '^VSDRIVE BIN') ]]; then echo "A2CLOUD: Copying VSDRIVE..." @@ -1513,16 +1513,16 @@ if [[ $a2CloudDisk ]]; then else echo "A2CLOUD: VSDRIVE is already on the target disk image." fi - + fi - + if [[ ! -f $a2CloudDisk140 || ( $(wc -c $a2CloudDisk140 | cut -f 1 -d ' ') != "143360" ) ]]; then echo "A2CLOUD: Creating 140K disk image..." mkpo "$a2CloudDisk140" A2CLOUD dd bs=256 count=1 of="$a2CloudDisk140" conv=notrunc 2> /dev/null < /usr/local/adtpro/disks/ADTPRO-*DSK dd bs=256 count=1 of="$a2CloudDisk140" skip=14 seek=14 conv=notrunc 2> /dev/null < /usr/local/adtpro/disks/ADTPRO-*DSK - + acmd -g $a2CloudDisk BASIC.SYSTEM - | acmd -p $a2CloudDisk140 BASIC.SYSTEM SYS acmd -g $a2CloudDisk PRODOS - | acmd -p $a2CloudDisk140 PRODOS SYS acmd -g $a2CloudDisk STARTUP - | acmd -p $a2CloudDisk140 STARTUP BAS @@ -1561,7 +1561,7 @@ if [[ $a2CloudDisk ]]; then else echo "A2CLOUD: A2PI client is already on the target disk image." fi - + if [[ -f /usr/local/adtpro/disks/Virtual.po && ! -L /usr/local/adtpro/disks/Virtual.po ]]; then mv /usr/local/adtpro/disks/Virtual.po /usr/local/adtpro/disks/defaultVirtual.po &> /dev/null vsd1 -f /usr/local/adtpro/disks/defaultVirtual.po @@ -1575,7 +1575,7 @@ if [[ $a2CloudDisk ]]; then fi vsd2 -f $a2CloudDisk - # for compatibility with pre-1.6.7 + # for compatibility with pre-1.6.7 ln -s /usr/local/adtpro/disks/A2CLOUD.PO /usr/local/adtpro/disks/A2CLOUD.HDV echo @@ -1706,7 +1706,7 @@ fi # √ can test if password is "raspberry" or "apple2" and advise accordingly # √ enable Uthernet by default in gsport-setup # √ enable AppleTalk Turbo by default in gsport-setup -# √ make kegs run as root +# √ make kegs run as root # √ consolidate gsport-setup and kegs-setup # √ gsport-setup is gsport, gsport-setup -k is kegs # √ clean up KEGS/GSport installer sections to be consistent diff --git a/setup/term.txt b/setup/term.txt index 3f8b1ff..58f3ca1 100644 --- a/setup/term.txt +++ b/setup/term.txt @@ -26,7 +26,7 @@ else term="vt100" elif [[ $(tr [:upper:] [:lower:] <<< $1) == "color" ]]; then term="pcansi" - elif [[ $(tr [:upper:] [:lower:] <<< $1) == "none" ]]; then + elif [[ $(tr [:upper:] [:lower:] <<< $1) == "none" ]]; then term="dumb" else term="$1" diff --git a/setup/usbgetty.txt b/setup/usbgetty.txt index 9400465..a0751ed 100644 --- a/setup/usbgetty.txt +++ b/setup/usbgetty.txt @@ -26,7 +26,7 @@ if [[ $(grep -e '-scanttyUSB' <<< "$*") ]]; then # echo "scantty no devices eligible: sleeping" sleep 86399 fi - + # echo "result:$ttyUSB" elif [[ $(grep -o 'ttyUSB[^ ]*' <<< "$*") ]]; then # echo "device specified"