]> git.street.me.uk Git - andy/dehydrated.git/commitdiff
moved OSTYPE check and use built-in [[ for OSTYPE check
authorLukas Schauer <lukas@schauer.so>
Sat, 16 Jan 2016 21:28:17 +0000 (22:28 +0100)
committerLukas Schauer <lukas@schauer.so>
Sat, 16 Jan 2016 21:28:17 +0000 (22:28 +0100)
letsencrypt.sh

index d2769410dc002f9abb0be402e2edaee15f6dfe28..18a2619ad481781c0fd7dc91915713d2ce994831 100755 (executable)
@@ -145,7 +145,7 @@ init_system() {
 
 # Different sed version for different os types...
 _sed() {
-  if [ "${OSTYPE}" = "Linux" ]; then
+  if [[ "${OSTYPE}" = "Linux" ]]; then
     sed -r "${@}"
   else
     sed -E "${@}"
@@ -520,8 +520,6 @@ command_env() {
 
 # Main method (parses script arguments and calls command_* methods)
 main() {
-  OSTYPE="$(uname)"
-
   COMMAND=""
   set_command() {
     [[ -z "${COMMAND}" ]] || _exiterr "Only one command can be executed at a time. See help (-h) for more information."
@@ -633,6 +631,9 @@ main() {
   esac
 }
 
+# Determine OS type
+OSTYPE="$(uname)"
+
 # Check for missing dependencies
 check_dependencies