Compare commits
	
		
			No commits in common. "90cdb8f93eaf890e7c5784394cb449bb92132b9c" and "e9c21e3063bda2acee96b954cf73735ee09c3df9" have entirely different histories.
		
	
	
		
			90cdb8f93e
			...
			e9c21e3063
		
	
		
							
								
								
									
										17
									
								
								install.sh
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								install.sh
									
									
									
									
									
								
							@ -12,10 +12,6 @@
 | 
				
			|||||||
# curl -fsSL https://example.com/setup-min.bash | bash
 | 
					# curl -fsSL https://example.com/setup-min.bash | bash
 | 
				
			||||||
# wget -nv https://example.com/setup-min.bash -O - | bash
 | 
					# wget -nv https://example.com/setup-min.bash -O - | bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Not every platform has or needs sudo, gotta save them O(1)s...
 | 
					 | 
				
			||||||
sudo_cmd=""
 | 
					 | 
				
			||||||
((EUID)) && [[ -z "$ANDROID_ROOT" ]] && sudo_cmd="sudo"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
deps_flag="$1"
 | 
					deps_flag="$1"
 | 
				
			||||||
set -e
 | 
					set -e
 | 
				
			||||||
set -u
 | 
					set -u
 | 
				
			||||||
@ -99,7 +95,7 @@ elif [ "$(uname | grep -i 'Linux')" ]; then
 | 
				
			|||||||
    exit 1
 | 
					    exit 1
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if [ -n "$(uname -a | grep 64)" ]; then
 | 
					  if [ -n "$(arch | grep 64)" ]; then
 | 
				
			||||||
    ARCH="64"
 | 
					    ARCH="64"
 | 
				
			||||||
  else
 | 
					  else
 | 
				
			||||||
    ARCH="32"
 | 
					    ARCH="32"
 | 
				
			||||||
@ -121,8 +117,6 @@ elif [ "$(uname | grep -i 'Linux')" ]; then
 | 
				
			|||||||
    OS='raspbian'
 | 
					    OS='raspbian'
 | 
				
			||||||
  elif [ "$(cat /etc/issue | grep -i 'Fedora')" ]; then
 | 
					  elif [ "$(cat /etc/issue | grep -i 'Fedora')" ]; then
 | 
				
			||||||
    OS='fedora'
 | 
					    OS='fedora'
 | 
				
			||||||
  elif [ "$(cat /etc/issue | grep -i 'Marvell')" ]; then
 | 
					 | 
				
			||||||
    OS='marvell'
 | 
					 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
  echo "unsupported unknown os (non-mac, non-linux)"
 | 
					  echo "unsupported unknown os (non-mac, non-linux)"
 | 
				
			||||||
@ -140,9 +134,6 @@ case "${OS}" in
 | 
				
			|||||||
  raspbian)
 | 
					  raspbian)
 | 
				
			||||||
    SETUP_FILE="ubuntu"
 | 
					    SETUP_FILE="ubuntu"
 | 
				
			||||||
    ;;
 | 
					    ;;
 | 
				
			||||||
  marvell)
 | 
					 | 
				
			||||||
    SETUP_FILE="ubuntu"
 | 
					 | 
				
			||||||
    ;;
 | 
					 | 
				
			||||||
  yosemite)
 | 
					  yosemite)
 | 
				
			||||||
    # mavericks
 | 
					    # mavericks
 | 
				
			||||||
    SETUP_FILE="mavericks"
 | 
					    SETUP_FILE="mavericks"
 | 
				
			||||||
@ -245,10 +236,10 @@ fi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
if [ -z "$NODEJS_VER" ]; then
 | 
					if [ -z "$NODEJS_VER" ]; then
 | 
				
			||||||
  if [ -n "$(type -p curl)" ]; then
 | 
					  if [ -n "$(type -p curl)" ]; then
 | 
				
			||||||
    NODEJS_VER=$(curl -fsL "$NODEJS_BASE_URL/dist/index.tab" | head -n 2 | tail -1 | cut -f 1) \
 | 
					    NODEJS_VER=$(curl -fsL "$NODEJS_BASE_URL/dist/index.tab" | head -2 | tail -1 | cut -f 1) \
 | 
				
			||||||
      || echo 'error automatically determining current node.js version'
 | 
					      || echo 'error automatically determining current node.js version'
 | 
				
			||||||
  elif [ -n "$(type -p wget)" ]; then
 | 
					  elif [ -n "$(type -p wget)" ]; then
 | 
				
			||||||
    NODEJS_VER=$(wget --quiet "$NODEJS_BASE_URL/dist/index.tab" -O - | head -n 2 | tail -1 | cut -f 1) \
 | 
					    NODEJS_VER=$(wget --quiet "$NODEJS_BASE_URL/dist/index.tab" -O - | head -2 | tail -1 | cut -f 1) \
 | 
				
			||||||
      || echo 'error automatically determining current node.js version'
 | 
					      || echo 'error automatically determining current node.js version'
 | 
				
			||||||
  else
 | 
					  else
 | 
				
			||||||
    echo "Found neither 'curl' nor 'wget'. Can't Continue."
 | 
					    echo "Found neither 'curl' nor 'wget'. Can't Continue."
 | 
				
			||||||
@ -293,7 +284,7 @@ if [ -n "${NODEJS_VER}" ]; then
 | 
				
			|||||||
  bash "/tmp/${INSTALL_FILE}" "${NODEJS_VER}"
 | 
					  bash "/tmp/${INSTALL_FILE}" "${NODEJS_VER}"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$sudo_cmd chown -R $(whoami) $node_install_path/lib/node_modules
 | 
					sudo chown -R $(whoami) $node_install_path/lib/node_modules
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo ""
 | 
					echo ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -2,10 +2,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# curl -fsSL https://ldsconnect.org/setup-linux.bash | bash -c
 | 
					# curl -fsSL https://ldsconnect.org/setup-linux.bash | bash -c
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Not every platform has or needs sudo, gotta save them O(1)s...
 | 
					 | 
				
			||||||
sudo_cmd=""
 | 
					 | 
				
			||||||
((EUID)) && [[ -z "$ANDROID_ROOT" ]] && sudo_cmd="sudo"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
NO_FAIL2BAN=${1}
 | 
					NO_FAIL2BAN=${1}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo ""
 | 
					echo ""
 | 
				
			||||||
@ -22,7 +18,7 @@ echo "    * jshint"
 | 
				
			|||||||
echo ""
 | 
					echo ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo "updating apt-get..."
 | 
					echo "updating apt-get..."
 | 
				
			||||||
$sudo_cmd bash -c "apt-get update -qq -y < /dev/null" > /dev/null
 | 
					sudo bash -c "apt-get update -qq -y < /dev/null" > /dev/null
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# fail2ban
 | 
					# fail2ban
 | 
				
			||||||
#if [ -z "$(which fail2ban-server | grep fail2ban)" ]; then
 | 
					#if [ -z "$(which fail2ban-server | grep fail2ban)" ]; then
 | 
				
			||||||
@ -36,5 +32,5 @@ $sudo_cmd bash -c "apt-get update -qq -y < /dev/null" > /dev/null
 | 
				
			|||||||
if [ -z "$(type -p pkg-config)" ] || [ -z "$(type -p git)" ] || [ -z "$(type -p wget)" ] || [ -z "$(type -p curl)" ] || [ -z "$(type -p gcc)" ] || [ -z "$(type -p rsync)" ] || [ -z "$(type -p python)" ]
 | 
					if [ -z "$(type -p pkg-config)" ] || [ -z "$(type -p git)" ] || [ -z "$(type -p wget)" ] || [ -z "$(type -p curl)" ] || [ -z "$(type -p gcc)" ] || [ -z "$(type -p rsync)" ] || [ -z "$(type -p python)" ]
 | 
				
			||||||
then
 | 
					then
 | 
				
			||||||
  echo "installing git, wget, curl, build-essential, rsync, pkg-config, python..."
 | 
					  echo "installing git, wget, curl, build-essential, rsync, pkg-config, python..."
 | 
				
			||||||
  $sudo_cmd bash -c "apt-get install -qq -y git wget curl build-essential rsync pkg-config python < /dev/null" > /dev/null 2>/dev/null
 | 
					  sudo bash -c "apt-get install -qq -y git wget curl build-essential rsync pkg-config python < /dev/null" > /dev/null 2>/dev/null
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
				
			|||||||
@ -1,9 +1,5 @@
 | 
				
			|||||||
#!/bin/bash
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Not every platform has or needs sudo, gotta save them O(1)s...
 | 
					 | 
				
			||||||
sudo_cmd=""
 | 
					 | 
				
			||||||
((EUID)) && [[ -z "$ANDROID_ROOT" ]] && sudo_cmd="sudo"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
set -e
 | 
					set -e
 | 
				
			||||||
set -u
 | 
					set -u
 | 
				
			||||||
set -o pipefail
 | 
					set -o pipefail
 | 
				
			||||||
@ -31,15 +27,15 @@ then
 | 
				
			|||||||
  NODEJS_NAME="iojs"
 | 
					  NODEJS_NAME="iojs"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ -n "$(uname -a | grep aarch64)" ]; then
 | 
					if [ -n "$(arch | grep aarch64)" ]; then
 | 
				
			||||||
  ARCH="arm64"
 | 
					  ARCH="arm64"
 | 
				
			||||||
elif [ -n "$(uname -a | grep 64)" ]; then
 | 
					elif [ -n "$(arch | grep 64)" ]; then
 | 
				
			||||||
  ARCH="x64"
 | 
					  ARCH="x64"
 | 
				
			||||||
elif [ -n "$(uname -a | grep armv8l)" ]; then
 | 
					elif [ -n "$(arch | grep armv8l)" ]; then
 | 
				
			||||||
  ARCH="arm64"
 | 
					  ARCH="arm64"
 | 
				
			||||||
elif [ -n "$(uname -a | grep armv7l)" ]; then
 | 
					elif [ -n "$(arch | grep armv7l)" ]; then
 | 
				
			||||||
  ARCH="armv7l"
 | 
					  ARCH="armv7l"
 | 
				
			||||||
elif [ -n "$(uname -a | grep armv6l)" ]; then
 | 
					elif [ -n "$(arch | grep armv6l)" ]; then
 | 
				
			||||||
  ARCH="armv6l"
 | 
					  ARCH="armv6l"
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
  ARCH="x86"
 | 
					  ARCH="x86"
 | 
				
			||||||
@ -63,14 +59,11 @@ if [ -n "${NODEJS_VER}" ]; then
 | 
				
			|||||||
  fi
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  mkdir -p ${NODEJS_UNTAR}/
 | 
					  mkdir -p ${NODEJS_UNTAR}/
 | 
				
			||||||
  # --strip-components isn't portable, switch to portable version by performing move step after untar
 | 
					  tar xf ${NODEJS_LOCAL} -C ${NODEJS_UNTAR}/ --strip-components=1
 | 
				
			||||||
  tar xf ${NODEJS_LOCAL} -C ${NODEJS_UNTAR}/ #--strip-components=1
 | 
					  rm ${NODEJS_UNTAR}/{LICENSE,CHANGELOG.md,README.md}
 | 
				
			||||||
  mv ${NODEJS_UNTAR}/${NODEJS_NAME}-${NODEJS_VER}-linux-${ARCH}/* ${NODEJS_UNTAR}/
 | 
					  sudo rsync -a "${NODEJS_UNTAR}/" "$node_install_path/"
 | 
				
			||||||
  rm -rf ${NODEJS_UNTAR}/${NODEJS_NAME}-${NODEJS_VER}-linux-${ARCH} # clean up the temporary unzip folder
 | 
					 | 
				
			||||||
  rm ${NODEJS_UNTAR}/{LICENSE,CHANGELOG.md,README.md} 
 | 
					 | 
				
			||||||
  $sudo_cmd rsync -av "${NODEJS_UNTAR}/" "$node_install_path/"
 | 
					 | 
				
			||||||
  rm -rf "${NODEJS_UNTAR}"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  $sudo_cmd chown -R $(whoami) "$node_install_path/lib/node_modules/"
 | 
					
 | 
				
			||||||
  $sudo_cmd chown $(whoami) ""$node_install_path"/bin/"
 | 
					  sudo chown -R $(whoami) "$node_install_path/lib/node_modules/"
 | 
				
			||||||
fi
 | 
					  sudo chown $(whoami) ""$node_install_path"/bin/"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user