Loading agent/agent.sh +4 −4 Original line number Diff line number Diff line Loading @@ -38,13 +38,13 @@ function downloadUpdate { URL="https://raw.githubusercontent.com/kroese/virtual-dsm/master/agent/agent.sh" remote_size=$(curl -sIk -m 4 "${URL}" | grep -i "content-length:" | tr -d " \t" | cut -d ':' -f 2) [ "$remote_size" == "" ] && return [ "$remote_size" == "0" ] && return [[ "$remote_size" == "" ]] && return [[ "$remote_size" == "0" ]] && return SCRIPT=$(readlink -f ${BASH_SOURCE[0]}) local_size=$(stat -c%s "$SCRIPT") [ "$remote_size" == "$local_size" ] && return [[ "$remote_size" == "$local_size" ]] && return if ! curl -sfk -m 10 -o "${TMP}" "${URL}"; then echo "$HEADER: curl error" && return Loading @@ -56,7 +56,7 @@ function downloadUpdate { line=$(head -1 "${TMP}") if [ "$line" != "#!/usr/bin/env bash" ]; then if [[ "$line" != "#!/usr/bin/env bash" ]]; then echo "$HEADER: update error, invalid header: $line" && return fi Loading Loading
agent/agent.sh +4 −4 Original line number Diff line number Diff line Loading @@ -38,13 +38,13 @@ function downloadUpdate { URL="https://raw.githubusercontent.com/kroese/virtual-dsm/master/agent/agent.sh" remote_size=$(curl -sIk -m 4 "${URL}" | grep -i "content-length:" | tr -d " \t" | cut -d ':' -f 2) [ "$remote_size" == "" ] && return [ "$remote_size" == "0" ] && return [[ "$remote_size" == "" ]] && return [[ "$remote_size" == "0" ]] && return SCRIPT=$(readlink -f ${BASH_SOURCE[0]}) local_size=$(stat -c%s "$SCRIPT") [ "$remote_size" == "$local_size" ] && return [[ "$remote_size" == "$local_size" ]] && return if ! curl -sfk -m 10 -o "${TMP}" "${URL}"; then echo "$HEADER: curl error" && return Loading @@ -56,7 +56,7 @@ function downloadUpdate { line=$(head -1 "${TMP}") if [ "$line" != "#!/usr/bin/env bash" ]; then if [[ "$line" != "#!/usr/bin/env bash" ]]; then echo "$HEADER: update error, invalid header: $line" && return fi Loading