Skip to content

Commit

Permalink
app-install: add flag to finish DietPi / dietpi-software install
Browse files Browse the repository at this point in the history
Signed-off-by: Dirk Hohndel <[email protected]>
  • Loading branch information
dirkhh committed Dec 24, 2024
1 parent 7a47a01 commit 8b10f9d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/tools/app-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ USAGE="
-s srcdir # the git checkout parent dir
-b branch # the branch to use (default: main)
-t tag # alternatively the tag to use
-f # finish an install on DietPi using dietpi-software
"

ROOT_REQUIRED="
Expand Down Expand Up @@ -37,6 +38,7 @@ APP_DIR="/opt/adsb"
BRANCH=""
GIT_PARENT_DIR=""
TAG=""
FINISH_DIETPI=""

while (( $# ))
do
Expand All @@ -47,11 +49,27 @@ do
;;
'-t') shift; TAG=$1
;;
'-f') FINISH_DIETPI="1"
;;
*) exit_message "$USAGE"
esac
shift
done

if [[ $FINISH_DIETPI == "1" ]] ; then
# are we just finishing up the install from dietpi-software?
if [[ -d /boot/dietpi && -f /boot/dietpi/.version ]] ; then
# shellcheck disable=SC1091
source /boot/dietpi/.version
OS="DietPi ${G_DIETPI_VERSION_CORE}.${G_DIETPI_VERSION_SUB}"
echo "app-install from $OS" > /opt/adsb/adsb.im.previous-version
# and for now that's all we need
exit 0
else
exit_message "do not use '-f' outside of installing via dietpi-software on DietPi"
fi
fi

if [[ $GIT_PARENT_DIR == '' ]] ; then
GIT_PARENT_DIR=$(mktemp -d)
# shellcheck disable=SC2064
Expand Down

0 comments on commit 8b10f9d

Please sign in to comment.