From c74c1af3b750ea57c208739f147ea961ab710241 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Mon, 23 Nov 2015 18:03:15 -0800 Subject: [PATCH] setup.txt: That should do it for paths --- setup/setup.txt | 98 ++++++++++++++++++++++++------------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/setup/setup.txt b/setup/setup.txt index f480d2e..24b3a2e 100644 --- a/setup/setup.txt +++ b/setup/setup.txt @@ -202,7 +202,7 @@ else installADTPro= echo echo -n "Install ADTPro server, for virtual drives and floppy disk transfers" - if [[ ! -f /usr/bin/X ]]; then + if ! command -v X >/dev/null; then echo echo -n "(the X Window System and LXDE desktop environment will be installed)" fi @@ -392,7 +392,7 @@ source /usr/local/etc/a2cloudrc echo "A2CLOUD: Saving installer version..." echo "$version" | sudo tee /usr/local/etc/A2CLOUD-version &> /dev/null -if [[ ! $(dpkg -l avahi-daemon 2> /dev/null | grep ^ii) || ! $(dpkg -l libnss-mdns 2> /dev/null | grep ^ii) ]]; then +if ! dpkg-query -l avahi-daemon &>/dev/null || ! dpkg-query -l libnss-mdns &>/dev/null; then echo "A2CLOUD: Installing avahi-daemon (mDNS)..." sudo apt-get -y install avahi-daemon &> /dev/null sudo apt-get -y clean @@ -420,7 +420,7 @@ if [[ $installADTPro ]]; then [[ $0 == "-bash" ]] && return 3 || exit 3 fi - if [[ ! -f /usr/bin/X ]]; then + if ! command -v X >/dev/null; then echo "A2CLOUD: Installing X Window System and LXDE..." sudo apt-get -y install xorg lxde sudo apt-get -y clean @@ -431,13 +431,6 @@ if [[ $installADTPro ]]; then 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 - # else - # echo "A2CLOUD: Terminal window already set to auto-open on desktop." - # fi - if { lspci 2> /dev/null | grep -q VirtualBox; }; then if { ! grep -q default /etc/xdg/lxsession/LXDE/autostart; }; then echo "A2CLOUD: Setting desktop to 800x600 in VirtualBox console (no Additions)..." @@ -573,8 +566,8 @@ if [[ $installADTPro ]]; then [[ ! -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 + if ! command -v xvfb-run >/dev/null; then + echo "A2CLOUD: Installing xvfb for headless operation..." sudo apt-get -y install xvfb sudo apt-get -y clean else @@ -655,7 +648,7 @@ if [[ $setupSerialPortLogin ]]; then sudo sed -i 's/^\(T.*\)ttyAMA0 .* /#\1ttyAMA0 4800 /' /etc/inittab sudo sed -i 's/ttyAMA0,[0-9]*/ttyAMA0,4800/g' /boot/cmdline.txt 2> /dev/null - if [[ ! -f /usr/bin/screen ]]; then + if ! command -v screen >/dev/null; then echo "A2CLOUD: Installing Screen for multiple terminals..." sudo apt-get -y install screen sudo apt-get -y clean @@ -756,7 +749,7 @@ fi if [[ $installCommTools ]]; then - if [[ ! -f /usr/bin/curl ]]; then + if ! command -v curl >/dev/null; then echo "A2CLOUD: Installing curl..." sudo apt-get -y install curl sudo apt-get -y clean @@ -764,7 +757,7 @@ if [[ $installCommTools ]]; then echo "A2CLOUD: curl is already installed." fi - if [[ ! -f /usr/bin/sz ]]; then + if ! command -v sz >/dev/null; then echo "A2CLOUD: Installing rzsz for X/Y/Zmodem transfers..." sudo apt-get -y install lrzsz sudo apt-get -y clean @@ -772,7 +765,7 @@ if [[ $installCommTools ]]; then echo "A2CLOUD: rzsz is already installed." fi - if [[ ! -f /usr/bin/ftp ]]; then + if ! command -v ftp >/dev/null; then echo "A2CLOUD: Installing ftp..." sudo apt-get -y install ftp sudo apt-get -y clean @@ -780,7 +773,7 @@ if [[ $installCommTools ]]; then echo "A2CLOUD: ftp is already installed." fi - if [[ ! -f /usr/local/bin/cftp ]]; then + if ! command -v cftp >/dev/null; then echo "A2CLOUD: Installing cftp..." cd /tmp/a2cloud-install if [[ $downloadBinaries ]]; then @@ -790,7 +783,7 @@ if [[ $installCommTools ]]; then wget -qO- http://appleii.ivanx.com/a2cloud/files/cftp-debian7_x86.tgz | sudo tar Pzx fi fi - if [[ ! -f /usr/local/bin/cftp ]]; then + if ! command -v cftp >/dev/null; then sudo apt-get -y install build-essential sudo apt-get -y install ncurses-dev sudo apt-get -y clean @@ -810,7 +803,7 @@ if [[ $installCommTools ]]; then echo "A2CLOUD: cftp is already installed." fi - if [[ ! -f /usr/bin/lynx ]]; then + if ! command -v lynx >/dev/null; then echo "A2CLOUD: Installing lynx..." sudo apt-get -y install lynx sudo apt-get -y clean @@ -818,7 +811,7 @@ if [[ $installCommTools ]]; then echo "A2CLOUD: lynx is already installed." fi - if [[ ! -f /usr/bin/links ]]; then + if ! command -v links >/dev/null; then echo "A2CLOUD: Installing links..." sudo apt-get -y --force-yes install links sudo apt-get -y clean @@ -828,7 +821,7 @@ if [[ $installCommTools ]]; then sudo wget -qO /usr/local/bin/a2news ${scriptURL}setup/a2news.txt sudo chmod ugo+x /usr/local/bin/a2news - if [[ ! -f /usr/bin/tin ]]; then + if ! command -v tin >/dev/null; then echo "A2CLOUD: Installing a2news/tin..." sudo apt-get -y install tin sudo apt-get -y clean @@ -853,7 +846,7 @@ if [[ $installCommTools ]]; then sudo wget -qO /usr/local/bin/a2chat ${scriptURL}setup/a2chat.txt sudo chmod ugo+x /usr/local/bin/a2chat - if [[ ! -f /usr/bin/irssi ]]; then + if ! command -v irssi >/dev/null; then echo "A2CLOUD: Installing a2chat/irssi..." sudo apt-get -y install irssi sudo apt-get -y clean @@ -861,7 +854,7 @@ if [[ $installCommTools ]]; then echo "A2CLOUD: a2chat/irssi is already installed." fi - if [[ ! -f /usr/bin/telnet ]]; then + if ! command -v telnet >/dev/null; then echo "A2CLOUD: Installing telnet..." sudo apt-get -y install telnet sudo apt-get -y clean @@ -869,7 +862,9 @@ if [[ $installCommTools ]]; then echo "A2CLOUD: telnet is already installed." fi - if [[ ( ! -f /usr/bin/ttytter && ! -f /usr/local/bin/ttytter ) || ! -f "/usr/local/share/perl/5.14.2/Term/ReadLine/TTYtter.pm" ]]; then + # Do we need to check for the readline module here as well? + #if [[ ( ! -f /usr/bin/ttytter && ! -f /usr/local/bin/ttytter ) || ! -f "/usr/local/share/perl/5.14.2/Term/ReadLine/TTYtter.pm" ]]; then + if ! command -v ttyter >/dev/null; 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 @@ -914,7 +909,7 @@ if [[ $installCommTools ]]; then fi if [[ $installA2Pi ]]; then - if [[ ! -f /sbin/a2pid ]]; then + if dpkg-query -l a2pi &>/dev/null; then echo "A2CLOUD: Installing Apple II Pi..." cd /tmp/a2cloud-install if ! grep 'schmenk.is-a-geek.com' /etc/apt/sources.list; then @@ -931,7 +926,7 @@ if [[ $installA2Pi ]]; then sudo apt-get -y install libpcap0.8-dev sudo apt-get -y clean fi - if [[ ! -f /usr/bin/gsport ]]; then + if ! command -v gsport >/dev/null; then # echo "A2CLOUD: Updating package repositories to include Apple II Pi..." # sudo apt-get -y update > /dev/null echo "A2CLOUD: Installing Apple II Pi extras (GSport)..." @@ -978,7 +973,7 @@ fi if [[ $installEmulators ]]; then # KEGS - if [[ ! -f /usr/local/bin/xkegs ]]; then + if ! command -v xkegs >/dev/null; then echo "A2CLOUD: Installing KEGS..." cd /tmp/a2cloud-install if [[ $downloadBinaries ]]; then @@ -988,7 +983,7 @@ if [[ $installEmulators ]]; then wget -qO- http://appleii.ivanx.com/a2cloud/files/kegs-debian7_x86.tgz | sudo tar Pzx fi fi - if [[ ! -f /usr/local/bin/xkegs ]]; then + if ! command -v xkegs >/dev/null; then echo "A2CLOUD: Building KEGS from source..." sudo apt-get -y install build-essential &> /dev/null sudo apt-get -y install libx11-dev libxext-dev xfonts-base &> /dev/null @@ -1047,7 +1042,7 @@ if [[ $installEmulators ]]; then wget -qO- http://appleii.ivanx.com/a2cloud/files/gsport-debian7_x86.tgz | sudo tar Pzx 2> /dev/null fi fi - if [[ ! -f /usr/local/bin/gsport ]]; then + if ! command -v gsport >/dev/null; then echo "A2CLOUD: Building GSport from source..." sudo apt-get -y install build-essential &> /dev/null sudo apt-get -y install libx11-dev libxext-dev xfonts-base libpcap0.8-dev &> /dev/null @@ -1125,7 +1120,7 @@ if [[ $installEmulators ]]; then # LinApple - if [[ ! -f /usr/local/linapple/linapple ]]; then + if ! command -v linapple >/dev/null; then echo "A2CLOUD: Installing LinApple..." cd /tmp/a2cloud-install if [[ $downloadBinaries ]]; then @@ -1135,7 +1130,7 @@ if [[ $installEmulators ]]; then wget -qO- http://appleii.ivanx.com/a2cloud/files/linapple-debian7_x86.tgz | sudo tar Pzx fi fi - if [[ ! -f /usr/local/linapple/linapple ]]; then + if ! command -v linapple >/dev/null; then sudo apt-get -y install build-essential sudo apt-get -y install libsdl1.2-dev libcurl4-openssl-dev zlib1g-dev libzip-dev sudo apt-get -y clean @@ -1168,8 +1163,9 @@ fi if [[ $installArchiveTools ]]; then if [[ ! -f /usr/local/bin/nulib2 || ! -f /usr/local/bin/sciibin || ! -f /usr/local/bin/usq ]]; then + if ! command -v nulib2 >/dev/null; then - echo "A2CLOUD: Installing nulib2, sciibin, unblu, unbit, unexec, usq..." + echo "A2CLOUD: Installing nulib2..." cd /tmp/a2cloud-install if [[ $downloadBinaries ]]; then @@ -1179,7 +1175,7 @@ if [[ $installArchiveTools ]]; then wget -qO- http://appleii.ivanx.com/a2cloud/files/nulib2-debian7_x86.tgz | sudo tar Pzx fi fi - if [[ ! -f /usr/local/bin/nulib2 ]]; then + if ! command -v nulib2 >/dev/null; then sudo apt-get -y install build-essential sudo apt-get -y install zlib1g-dev sudo apt-get -y clean @@ -1201,23 +1197,27 @@ if [[ $installArchiveTools ]]; then cd /tmp/a2cloud-install rm -rf nulib fi - - if [[ ! -f /usr/local/bin/sciibin || ! -f /usr/local/bin/usq ]]; then - # install sciibin/unblu/unbit/unexec/usq - sudo apt-get -y install build-essential - sudo apt-get -y clean - rm -rf undoit &> /dev/null - mkdir -p undoit - cd undoit - 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 - cd /tmp/a2cloud-install - rm -rf undoit - fi else - echo "A2CLOUD: nulib2, sciibin, unblu, unbit, unexec, usq are already installed." + echo "A2CLOUD: nulib2 is already installed." + fi + + if ! command -v sciibin >/dev/null; then + + echo "A2CLOUD: Installing sciibin, unblu, unbit, unexec, usq..." + + sudo apt-get -y install build-essential + sudo apt-get -y clean + rm -rf undoit &> /dev/null + mkdir -p undoit + cd undoit + 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 + cd /tmp/a2cloud-install + rm -rf undoit + else + echo "A2CLOUD: sciibin, unblu, unbit, unexec, usq are already installed." fi echo "A2CLOUD: Setting up shk2image command..."