mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-24 22:58:43 +01:00
pipe stdouts
This commit is contained in:
parent
b460147eaa
commit
016b1a20f4
1 changed files with 6 additions and 7 deletions
|
@ -55,8 +55,8 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||||
echo "# *** INSTALL ZeroTier ***"
|
echo "# *** INSTALL ZeroTier ***"
|
||||||
|
|
||||||
# Download ZeroTier GPG key and install ZeroTier
|
# Download ZeroTier GPG key and install ZeroTier
|
||||||
curl -s 'https://raw.githubusercontent.com/zerotier/ZeroTierOne/master/doc/contact%40zerotier.com.gpg' | gpg --import
|
$(curl -s 'https://raw.githubusercontent.com/zerotier/ZeroTierOne/master/doc/contact%40zerotier.com.gpg' | gpg --import)
|
||||||
if z=$(curl -s 'https://install.zerotier.com/' | gpg); then echo "$z" | sudo bash; fi
|
if z=$(curl -s 'https://install.zerotier.com/' | gpg); then echo "$z" | sudo bash 1>&2; fi
|
||||||
|
|
||||||
echo "# ZeroTier is now installed on your RaspiBlitz"
|
echo "# ZeroTier is now installed on your RaspiBlitz"
|
||||||
echo "# Joining zerotier network: ${networkID}"
|
echo "# Joining zerotier network: ${networkID}"
|
||||||
|
@ -69,7 +69,8 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||||
sudo sed -i "s/^zerotier=.*/zerotier=${networkID}/g" /mnt/hdd/raspiblitz.conf
|
sudo sed -i "s/^zerotier=.*/zerotier=${networkID}/g" /mnt/hdd/raspiblitz.conf
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "error='ZweroTier join failed'"
|
sudo -u admin sudo apt -y purge zerotier-one 1>&2
|
||||||
|
echo "error='ZeroTier join failed'"
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -77,13 +78,11 @@ fi
|
||||||
# switch off
|
# switch off
|
||||||
if [ "$1" = "0" ] || [ "$1" = "off" ]; then
|
if [ "$1" = "0" ] || [ "$1" = "off" ]; then
|
||||||
|
|
||||||
|
|
||||||
echo "# *** REMOVING ZEROTIER ***"
|
echo "# *** REMOVING ZEROTIER ***"
|
||||||
|
|
||||||
|
|
||||||
# leaving network & deinstall
|
# leaving network & deinstall
|
||||||
sudo zerotier-cli leave ${zerotier} 1>/dev/null 2>/dev/null
|
sudo zerotier-cli leave ${zerotier} 1>&2
|
||||||
sudo -u admin sudo apt -y purge zerotier-one
|
sudo -u admin sudo apt -y purge zerotier-one 1>&2
|
||||||
|
|
||||||
# setting value in raspi blitz config
|
# setting value in raspi blitz config
|
||||||
sudo sed -i "s/^zerotier=.*/zerotier=off/g" /mnt/hdd/raspiblitz.conf
|
sudo sed -i "s/^zerotier=.*/zerotier=off/g" /mnt/hdd/raspiblitz.conf
|
||||||
|
|
Loading…
Add table
Reference in a new issue