{% if with_shebang %}#!/usr/bin/env bash{% endif %}

INSTALL_SCRIPT_PATH=/tmp/install-packy-agent-main.sh

# Retries are required because at the moment of script execution (just after reboot) network may not be ready yet
wget $PACKY_SERVER_BASE_URL'/downloads/install-packy-agent.sh{% if download_args %}{{ download_args }}{% endif %}' -nv -O $INSTALL_SCRIPT_PATH --retry-connrefused --waitretry=120
chmod +x $INSTALL_SCRIPT_PATH

# We need a temp dir on microSD for Orange PI
TMPDIR=/pip-tmp
mkdir $TMPDIR
TMPDIR=$TMPDIR $INSTALL_SCRIPT_PATH
