Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate config only if we need it, do not generate for commands like remote_console/ping #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions priv/bin_script
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,21 @@ CUTTLEFISHCMD="$ERTS_DIR/bin/escript $RUNNER_BASE_DIR/bin/cuttlefish"

cd "$ROOTDIR"

if CUTTLEFISH_CONFIG=$($CUTTLEFISHCMD -e $RUNNER_ETC_DIR -d $RUNNER_BASE_DIR/generated.conf -s $RUNNER_BASE_DIR/share/schema/ -c $RUNNER_ETC_DIR/$CUTTLEFISH_CONF.new)
then
CONFIG_FILES="$CUTTLEFISH_CONFIG"
else
echo "Cuttlefish failed! Oh no!"
exit 1
fi
# Generate new config only if we need it
case "$1" in
console|console_clean|console_boot|foreground)
if CUTTLEFISH_CONFIG=$($CUTTLEFISHCMD -e $RUNNER_ETC_DIR -d $RUNNER_BASE_DIR/generated.conf -s $RUNNER_BASE_DIR/share/schema/ -c $RUNNER_ETC_DIR/$CUTTLEFISH_CONF.new)
then
CONFIG_FILES="$CUTTLEFISH_CONFIG"
else
echo "Cuttlefish failed! Oh no!"
exit 1
fi
;;
*)
# Do not generate config
;;
esac

# User can specify an sname without @hostname
# This will fail when creating remote shell
Expand Down