exit 0
fi
fi
-if [ "$cur_node" != "$new_node" ]; then
+if [ -n "$cur_node" ] && [ "$cur_node" != "$new_node" ]; then
echo "WARN: possible conflict with node v$WEBI_VERSION at $cur_node"
fi
set -e
set -u
-# Get arch envs, etc
-my_url="https://rootprojects.org/serviceman/dist/$(uname -s)/$(uname -m)/serviceman"
-curl -fsSL "$my_url" -o serviceman
-echo ""
-# Make executable
-chmod +x ./serviceman
-# Move to ~/.local/bin
-mkdir -p ~/.local/bin
-mv ./serviceman ~/.local/bin
-
# Test if in PATH
set +e
my_serviceman=$(command -v serviceman)
fi
fi
+# Get arch envs, etc
+webi_download "https://rootprojects.org/serviceman/dist/$(uname -s)/$(uname -m)/serviceman" "$HOME/Downloads/serviceman"
+chmod +x "$HOME/Downloads/serviceman"
+mv "$HOME/Downloads/serviceman" "$HOME/.local/bin/"
+
# add to ~/.local/bin to PATH, just in case
-pathman add ~/.local/bin # > /dev/null 2> /dev/null
+webi_path_add $HOME/.local/bin # > /dev/null 2> /dev/null
# TODO inform user to add to path, apart from pathman?
if [ -n "${1:-}" ]; then
my_url="$1"
else
+ if [ "error" == "$WEBI_CHANNEL" ]; then
+ echo "Could not find $WEBI_NAME v$WEBI_VERSION"
+ exit 1
+ fi
my_url="$WEBI_PKG_URL"
echo "Downloading $WEBI_NAME v$WEBI_VERSION"
fi