Skip to content

Commit

Permalink
Merge pull request #188 from tomeshnet/develop-opi
Browse files Browse the repository at this point in the history
Mostly patches for Debian OS
  • Loading branch information
darkdrgn2k committed Aug 29, 2018
2 parents 4c51369 + 61575c2 commit 95c71ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 11 additions & 1 deletion scripts/install2
Expand Up @@ -88,6 +88,8 @@ fi

echo -e "\e[1;32mStarting installation on ${BOARD_FAMILY} ${BOARD_NAME} (${BOARD_REVISION})...\e[0m"

# Normalize OS environment

# Enable password-less sudo on Armbian
sudo sed -i 's/ALL=(ALL:ALL) ALL/ALL=(ALL:ALL) NOPASSWD:ALL/' /etc/sudoers

Expand All @@ -108,8 +110,17 @@ if [[ -e '/etc/NetworkManager/NetworkManager.conf' ]]; then
echo "unmanaged-devices=interface-name:wlan0" | sudo tee --append /etc/NetworkManager/NetworkManager.conf > /dev/null
fi
fi

# Detect missing /sbin from $PATH variable on Debian distros, and add it
if [ -z $(echo $PATH | grep "/sbin") ]; then
# Current environment
export PATH="/sbin:/usr/sbin:$PATH"
# Next login
echo 'export PATH="/sbin:/usr/sbin:$PATH"' | sudo tee -a /etc/profile
fi

# Prompt and set missing flags

if [ -z "$WITH_MESH_POINT" -o "$WITH_MESH_POINT" != "true" -a "$WITH_MESH_POINT" != "false" ]; then
read -p "Configure Mesh Point interface (Y/n)? " -n 1 -r
echo ""
Expand Down Expand Up @@ -341,7 +352,6 @@ fi

# Install possibly missing tools
sudo apt-get install haveged -y || true
sudo apt-get install iw -y || true

# Check if cjdns is to be compiled or downloaded
if [[ ! -e "/usr/bin/cjdroute" ]]; then
Expand Down
6 changes: 3 additions & 3 deletions scripts/ipfs/ipfs-swarm-cjdns.sh
Expand Up @@ -2,7 +2,7 @@

# Wait for ipfs to initalize
attempts=15
until [[ $(curl http://localhost:5001/api/v0/id -q 2>/dev/null) || ${attempts} -eq 0 ]]; do
until [[ $(curl http://localhost:5001/api/v0/id -s 2>/dev/null) || ${attempts} -eq 0 ]]; do
sleep 1
attempts=$((attempts-1))
done
Expand All @@ -15,7 +15,7 @@ while read -r cjdns_peer; do
cjdns_addr=$(sudo /opt/cjdns/publictoip6 $cjdns_peer)

# See if they have IPFS enabled
res=$(curl http://[${cjdns_addr}]/nodeinfo.json)
res=$(curl http://[${cjdns_addr}]/nodeinfo.json -s)
if [ ! -x "$res" ]; then
id=$(echo ${res} | jq -r -M '.services.ipfs.ID')
# Value is found
Expand All @@ -33,4 +33,4 @@ while read -r cjdns_peer; do
done <<< `sudo nodejs /opt/cjdns/tools/peerStats 2>/dev/null | awk '{ if ($2 == "ESTABLISHED") print $1 }' | awk -F. '{ print $6".k" }' | xargs`
# Update peers data since ipfs just started
/usr/local/bin/nodeinfo-update.sh
sudo /usr/local/bin/nodeinfo-update.sh

0 comments on commit 95c71ac

Please sign in to comment.