Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Commit

Permalink
Don't downcase distro_name until needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas committed Apr 30, 2014
1 parent 470e603 commit 5a2cd10
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions platform/linux/services
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down
6 changes: 3 additions & 3 deletions platform/linux/settings
Original file line number Diff line number Diff line change
Expand Up @@ -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
get_distro_name # needed for self-setup (os_name is really distro name) and service-related functions

0 comments on commit 5a2cd10

Please sign in to comment.