Skip to content

Commit ece843e

Browse files
authored
User can opt to ethd update --no-screen (#2549)
* User can opt to ethd update --no-screen * First run
1 parent d08e3d7 commit ece843e

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

ethd

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2049,9 +2049,10 @@ update() {
20492049
fi
20502050

20512051
# This is long-running, and it's better if we're in a protected session if interactive
2052-
if [[ -z "${STY:-}" && -z "${TMUX:-}" && ! "$*" =~ "--non-interactive" && ! "${ETHD_FRONTEND:-}" = "noninteractive" ]]; then
2052+
if [[ -z "${ETHDSECUNDO:-}" && -z "${STY:-}" && -z "${TMUX:-}" && -n "${SSH_CONNECTION:-}" && ! "$*" =~ --no-screen \
2053+
&& ! "$*" =~ --non-interactive && ! "${ETHD_FRONTEND:-}" = "noninteractive" ]]; then
20532054
no_screen_cmd=0
2054-
echo "\"${__me} update\" benefits from running in a session that protects it against disconnects."
2055+
echo "\"${__me} update\" over SSH benefits from running in a session that protects it against disconnects."
20552056
if [[ -z "$(command -v screen)" ]]; then
20562057
if [[ "${__cannot_sudo}" -eq 0 && "${__distro}" =~ (ubuntu|debian) ]]; then
20572058
echo "Installing screen"
@@ -2061,10 +2062,6 @@ update() {
20612062
no_screen_cmd=1
20622063
fi
20632064
fi
2064-
if [[ -z "${SSH_CONNECTION:-}" ]]; then
2065-
no_screen_cmd=1
2066-
echo "You are in a local terminal session, not starting screen"
2067-
fi
20682065

20692066
if [[ "${no_screen_cmd}" -eq 0 ]]; then
20702067
local screen_session="${uniq_id}"
@@ -2178,6 +2175,9 @@ update() {
21782175
__debug=1
21792176
shift
21802177
;;
2178+
--no-screen)
2179+
shift
2180+
;;
21812181
*)
21822182
echo "Error: Unknown option: $1" >&2
21832183
shift
@@ -5924,7 +5924,7 @@ __verify_env_file() {
59245924

59255925

59265926
__update_help() {
5927-
echo "usage: ${__me} update [--refresh-targets] [--non-interactive]"
5927+
echo "usage: ${__me} update [--refresh-targets] [--non-interactive] [--no-screen]"
59285928
echo
59295929
echo "Updates ${__project_name} itself, as required the contents of \".env\", and the clients."
59305930
echo
@@ -5935,6 +5935,7 @@ __update_help() {
59355935
echo
59365936
echo "\"--refresh-targets\" sets Docker tags, source targets, and repos of clients back to the defaults in \"default.env\"."
59375937
echo "\"--non-interactive\" does not ask questions and assumes Yes for database resyncs and migrations."
5938+
echo "\"--no-screen\" does not use \"screen\" during the update."
59385939
echo
59395940
}
59405941

@@ -5950,7 +5951,7 @@ __full_help() {
59505951
echo " keys ACTION [--non-interactive] [--debug]"
59515952
echo " list, count, delete, import keys; their fee recipients; and gas fees"
59525953
echo " Run without ACTION to get help text"
5953-
echo " update [--refresh-targets] [--non-interactive] [--debug] [--trace]"
5954+
echo " update [--refresh-targets] [--non-interactive] [--no-screen] [--debug] [--trace]"
59545955
echo " updates all client versions and ${__project_name} itself"
59555956
echo " --refresh-targets will reset your custom build targets in ${__env_file} to defaults"
59565957
echo " up|start [service-name]"

0 commit comments

Comments
 (0)