Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix issues with blank log_to option

  • Loading branch information...
commit 3754bef58fa75cdb505c700c8adc773d35c658a1 1 parent 7d8e205
@rtomayko authored
Showing with 9 additions and 1 deletion.
  1. +4 −0 hem-init.sh
  2. +5 −1 hem-up.sh
View
4 hem-init.sh
@@ -53,6 +53,10 @@ if [ -f "$HEM_CONFIG" ]; then
info "backed up $(tildize "$HEM_CONFIG") to $(basename "$HEM_CONFIG")~"
fi
+# Set log_file to default if not set
+test -z "$log_to" &&
+log_to="$base_dir/log"
+
# Create template config file
mkdir -p "$base_dir"
mkdir -p "$base_dir/profile"
View
6 hem-up.sh
@@ -55,7 +55,6 @@ echo "$monitor_port" > "$statefile"
AUTOSSH_DEBUG=$front
AUTOSSH_GATETIME=30
AUTOSSH_LOGLEVEL=5
-AUTOSSH_LOGFILE="$log_to"
AUTOSSH_MAXSTART=-1
AUTOSSH_MESSAGE=
#AUTOSSH_PATH="$ssh_command"
@@ -64,10 +63,15 @@ AUTOSSH_POLL=${poll_time:-600}
AUTOSSH_FIRST_POLL=$AUTOSSH_POLL
AUTOSSH_PORT=${monitor_port:-0}
+# only set the log file if the log_to variable is set
+test -n "$log_to" &&
+AUTOSSH_LOGFILE="$log_to"
+
# export autossh environment
export AUTOSSH_DEBUG AUTOSSH_GATETIME AUTOSSH_LOGLEVEL AUTOSSH_LOGFILE \
AUTOSSH_PIDFILE AUTOSSH_POLL AUTOSSH_FIRST_POLL AUTOSSH_PORT
+
# XXX: there's some oddness with setting the AUTOSSH_PORT environment variable
# to zero that seems to stop autossh from coming up.
if [ "$AUTOSSH_PORT" = 0 ]; then
Please sign in to comment.
Something went wrong with that request. Please try again.