diff --git a/scripts/installUpgradeFunctions.sh b/scripts/installUpgradeFunctions.sh index 0ee7e7270..d55029d0a 100644 --- a/scripts/installUpgradeFunctions.sh +++ b/scripts/installUpgradeFunctions.sh @@ -55,7 +55,8 @@ export LIGHTTPD_CONFIG_FILE="/etc/lighttpd/lighttpd.conf" ##### # Display a header surrounded by stars. -function display_header() { +function display_header() +{ local HEADER="${1}" local LEN ((LEN = ${#HEADER} + 8)) # 8 for leading and trailing "*** " @@ -82,7 +83,8 @@ function calc_wt_size() ##### # Get a Git version, stripping any trailing newline. # Return "" if none, or on error. -function get_Git_version() { +function get_Git_version() +{ local BRANCH="${1}" local PACKAGE="${2}" local VF="$( basename "${ALLSKY_VERSION_FILE}" )" @@ -99,7 +101,8 @@ function get_Git_version() { ##### # Get the version from a local file, if it exists. If not, get from default file. -function get_version() { +function get_version() +{ local F="${1}" if [[ -z ${F} ]]; then F="${ALLSKY_VERSION_FILE}" # default @@ -116,7 +119,8 @@ function get_version() { ##### # Get the branch using git. -function get_branch() { +function get_branch() +{ local H="${1:-${ALLSKY_HOME}}" echo "$( cd "${H}" || exit; git rev-parse --abbrev-ref HEAD )" } @@ -125,7 +129,8 @@ function get_branch() { ##### # Get a shell variable's value. The variable can have optional spaces and tabs before it. # This function is useful when we can't "source" the file. -function get_variable() { +function get_variable() +{ local VARIABLE="${1}" local FILE="${2}" local LINE="" @@ -1054,7 +1059,8 @@ function get_computer() # files directly. This does assume that both the cli and cgi settings files # work in the same way. # -function get_php_setting() { +function get_php_setting() +{ local SETTING="${1}" php -r "echo ini_get('${SETTING}');" }