diff --git a/platform/linux/services b/platform/linux/services index 35d372f..a60f129 100644 --- a/platform/linux/services +++ b/platform/linux/services @@ -5,16 +5,16 @@ # Licensed under the GPLv3. #################################################################### -linux_load_service(){ - get_distro_name - [ -z "$distro_name" ] && return 1 - eval "${distro_name}_load_service $1" +linux_load_service() { + local downcased="$(echo "$distro_name" | lowercase)" + [ -z "$downcased" ] && return 1 + eval "${downcased}_load_service $1" } -linux_unload_service(){ - get_distro_name - [ -z "$distro_name" ] && return 1 - eval "${distro_name}_unload_service $1" +linux_unload_service() { + local downcased="$(echo "$distro_name" | lowercase)" + [ -z "$downcased" ] && return 1 + eval "${downcased}_unload_service $1" } linux_copy_init_script(){ diff --git a/platform/linux/settings b/platform/linux/settings index 0eae15b..f9b05b6 100755 --- a/platform/linux/settings +++ b/platform/linux/settings @@ -39,14 +39,14 @@ get_os_version() { fi fi fi - + readonly os_version } get_distro_name() { [ -n "$distro_name" ] && return - distro_name="$(lsb_release -i | awk '{print $3}' | lowercase)" + distro_name="$(lsb_release -i | awk '{print $3}')" } get_os_version -get_distro_name # needed for self-setup (os_name is really distro name) and service-related functions \ No newline at end of file +get_distro_name # needed for self-setup (os_name is really distro name) and service-related functions