diff options
Diffstat (limited to 'get-thin-edge_io.sh')
-rwxr-xr-x | get-thin-edge_io.sh | 68 |
1 files changed, 31 insertions, 37 deletions
diff --git a/get-thin-edge_io.sh b/get-thin-edge_io.sh index 49db1fb9..248874e9 100755 --- a/get-thin-edge_io.sh +++ b/get-thin-edge_io.sh @@ -18,40 +18,40 @@ EOF } install_basic_components() { - wget https://github.com/thin-edge/thin-edge.io/releases/download/${VERSION}/tedge_${VERSION}_${ARCH}.deb -P /tmp/tedge - wget https://github.com/thin-edge/thin-edge.io/releases/download/${VERSION}/tedge_mapper_${VERSION}_${ARCH}.deb -P /tmp/tedge + wget "https://github.com/thin-edge/thin-edge.io/releases/download/${VERSION}/tedge_${VERSION}_${ARCH}.deb" -P /tmp/tedge + wget "https://github.com/thin-edge/thin-edge.io/releases/download/${VERSION}/tedge_mapper_${VERSION}_${ARCH}.deb" -P /tmp/tedge - dpkg -i /tmp/tedge/tedge_${VERSION}_${ARCH}.deb - dpkg -i /tmp/tedge/tedge_mapper_${VERSION}_${ARCH}.deb + dpkg -i "/tmp/tedge/tedge_${VERSION}_${ARCH}.deb" + dpkg -i "/tmp/tedge/tedge_mapper_${VERSION}_${ARCH}.deb" } install_tedge_agent() { - wget https://github.com/thin-edge/thin-edge.io/releases/download/${VERSION}/tedge_agent_${VERSION}_${ARCH}.deb -P /tmp/tedge + wget "https://github.com/thin-edge/thin-edge.io/releases/download/${VERSION}/tedge_agent_${VERSION}_${ARCH}.deb" -P /tmp/tedge - dpkg -i /tmp/tedge/tedge_agent_${VERSION}_${ARCH}.deb + dpkg -i "/tmp/tedge/tedge_agent_${VERSION}_${ARCH}.deb" } install_tedge_plugins() { # Download and install apt plugin - wget https://github.com/thin-edge/thin-edge.io/releases/download/${VERSION}/tedge_apt_plugin_${VERSION}_${ARCH}.deb -P /tmp/tedge - dpkg -i /tmp/tedge/tedge_apt_plugin_${VERSION}_${ARCH}.deb + wget "https://github.com/thin-edge/thin-edge.io/releases/download/${VERSION}/tedge_apt_plugin_${VERSION}_${ARCH}.deb" -P /tmp/tedge + dpkg -i "/tmp/tedge/tedge_apt_plugin_${VERSION}_${ARCH}.deb" # Download and install apama plugin - wget https://github.com/thin-edge/thin-edge.io/releases/download/${VERSION}/tedge_apama_plugin_${VERSION}_${ARCH}.deb -P /tmp/tedge - dpkg -i /tmp/tedge/tedge_apama_plugin_${VERSION}_${ARCH}.deb - + wget "https://github.com/thin-edge/thin-edge.io/releases/download/${VERSION}/tedge_apama_plugin_${VERSION}_${ARCH}.deb" -P /tmp/tedge + dpkg -i "/tmp/tedge/tedge_apama_plugin_${VERSION}_${ARCH}.deb" + # Download and install configuration plugin - wget https://github.com/thin-edge/thin-edge.io/releases/download/${VERSION}/c8y_configuration_plugin_${VERSION}_${ARCH}.deb -P /tmp/tedge - dpkg -i /tmp/tedge/c8y_configuration_plugin_${VERSION}_${ARCH}.deb + wget "https://github.com/thin-edge/thin-edge.io/releases/download/${VERSION}/c8y_configuration_plugin_${VERSION}_${ARCH}.deb" -P /tmp/tedge + dpkg -i "/tmp/tedge/c8y_configuration_plugin_${VERSION}_${ARCH}.deb" # Download and install c8y log plugin - wget https://github.com/thin-edge/thin-edge.io/releases/download/${VERSION}/c8y_log_plugin_${VERSION}_${ARCH}.deb -P /tmp/tedge - dpkg -i /tmp/tedge/c8y_log_plugin_${VERSION}_${ARCH}.deb + wget "https://github.com/thin-edge/thin-edge.io/releases/download/${VERSION}/c8y_log_plugin_${VERSION}_${ARCH}.deb" -P /tmp/tedge + dpkg -i "/tmp/tedge/c8y_log_plugin_${VERSION}_${ARCH}.deb" # Download and install tedge_watchdog - wget https://github.com/thin-edge/thin-edge.io/releases/download/${VERSION}/tedge_watchdog_${VERSION}_${ARCH}.deb -P /tmp/tedge - dpkg -i /tmp/tedge/tedge_watchdog_${VERSION}_${ARCH}.deb + wget "https://github.com/thin-edge/thin-edge.io/releases/download/${VERSION}/tedge_watchdog_${VERSION}_${ARCH}.deb" -P /tmp/tedge + dpkg -i "/tmp/tedge/tedge_watchdog_${VERSION}_${ARCH}.deb" } if [ $# -lt 3 ]; then @@ -72,23 +72,15 @@ fi VERSION=$1 ARCH=$(dpkg --print-architecture) -BLUE='' -COLORRESET='' -if [ -t 1 ]; then - if [ "$(tput colors)" -ge 8 ]; then - BLUE='\033[1;34m' - COLORRESET='\033[0m' - fi -fi - -echo "${BLUE}Thank you for trying thin-edge.io! ${COLORRESET}\n" +echo "Thank you for trying thin-edge.io!" +echo if [ -z "$VERSION" ]; then VERSION=0.7.4 - echo "Version argument has not been provided, installing latest: ${BLUE}$VERSION${COLORRESET}" + echo "Version argument has not been provided, installing latest: $VERSION" echo "To install a particular version use this script with the version as an argument." - echo "For example: ${BLUE}sudo ./get-thin-edge_io.sh $VERSION${COLORRESET}" + echo "For example: sudo ./get-thin-edge_io.sh $VERSION" fi if [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ] || [ "$ARCH" = "armhf" ] || [ "$ARCH" = "amd64" ]; then @@ -103,7 +95,7 @@ if [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ] || [ "$ARCH" = "armhf" ] || exit 1 fi - echo "${BLUE}Installing for architecture $ARCH ${COLORRESET}" + echo "Installing for architecture $ARCH" else echo "$ARCH is currently not supported. Currently supported are aarch64/arm64, armhf and amd64." exit 0 @@ -113,7 +105,7 @@ if [ -d "/tmp/tedge" ]; then rm -R /tmp/tedge fi -echo "${BLUE}Installing mosquitto as prerequirement for thin-edge.io${COLORRESET}" +echo "Installing mosquitto as prerequirement for thin-edge.io" apt install mosquitto -y case $TYPE in @@ -121,7 +113,7 @@ minimal) install_basic_components ;; full) install_basic_components install_tedge_agent - if apt -v &>/dev/null; then + if apt -v >/dev/null 2>&1; then install_tedge_plugins fi ;; @@ -134,11 +126,13 @@ esac rm -R /tmp/tedge # Test if tedge command is there and working -tedge help >/dev/null -if [ $? -eq 0 ]; then - echo "\n${BLUE}thin-edge.io is now installed on your system!${COLORRESET}" +if tedge help >/dev/null; +then + echo + echo "thin-edge.io is now installed on your system!" echo "" - echo "You can go to our documentation to find next steps:${BLUE} https://github.com/thin-edge/thin-edge.io/blob/main/docs/src/howto-guides/003_registration.md ${COLORRESET}" + echo "You can go to our documentation to find next steps: https://github.com/thin-edge/thin-edge.io/blob/main/docs/src/howto-guides/003_registration.md" else - echo "Something went wrong in the installation process please try the manual installation steps instead:\n https://github.com/thin-edge/thin-edge.io/blob/main/docs/src/howto-guides/002_installation.md" + echo "Something went wrong in the installation process please try the manual installation steps instead:" + echo "https://github.com/thin-edge/thin-edge.io/blob/main/docs/src/howto-guides/002_installation.md" fi |