Skip to content

Commit 095397f

Browse files
chore: fix launch script not working on boot
1 parent 38ed952 commit 095397f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

server/scripts/auto-update.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ HASH_FILE="$RUSTY_HOME_DIR/current.sha256"
2020
show_usage () {
2121
echo "Parameters:"
2222
echo "-b: build binary (instead of downloading the latest release)"
23-
echo "-l: always launch (even if already up-to-date; useful on reboot)"
23+
echo "-l: only launch (useful on reboot since network may not be available yet)"
2424
}
2525

2626
while getopts "blh" opt; do
@@ -29,7 +29,7 @@ while getopts "blh" opt; do
2929
BUILD_BINARY="y"
3030
;;
3131
l)
32-
LAUNCH_ALWAYS="y"
32+
LAUNCH_ONLY="y"
3333
;;
3434
h)
3535
show_usage
@@ -117,6 +117,12 @@ fi
117117

118118
cd "$RUSTY_HOME_DIR" || exit 1
119119

120+
if [[ "$LAUNCH_ONLY" == "y" ]]; then
121+
printf "\n${INFO}Launching due to only launch flag$RESET\n\n"
122+
launch
123+
exit 0
124+
fi
125+
120126
if [[ -f "$HASH_FILE" ]]; then
121127
current_hash=$(cat "$HASH_FILE")
122128
update
@@ -134,11 +140,6 @@ if [[ -f "$HASH_FILE" ]]; then
134140
printf "\n${INFO}Server is not running$RESET\n\n"
135141
launch
136142
fi
137-
138-
if [[ "$LAUNCH_ALWAYS" == "y" ]]; then
139-
printf "\n${INFO}Launching due to always launch flag$RESET\n\n"
140-
launch
141-
fi
142143
fi
143144
else
144145
echo "$WARNING* Couldn't find current hash. Updating to latest version anyway.$RESET"

0 commit comments

Comments
 (0)