mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-04-18 14:39:46 +02:00
moved OSTYPE check and use built-in [[ for OSTYPE check
This commit is contained in:
@@ -145,7 +145,7 @@ init_system() {
|
|||||||
|
|
||||||
# Different sed version for different os types...
|
# Different sed version for different os types...
|
||||||
_sed() {
|
_sed() {
|
||||||
if [ "${OSTYPE}" = "Linux" ]; then
|
if [[ "${OSTYPE}" = "Linux" ]]; then
|
||||||
sed -r "${@}"
|
sed -r "${@}"
|
||||||
else
|
else
|
||||||
sed -E "${@}"
|
sed -E "${@}"
|
||||||
@@ -520,8 +520,6 @@ command_env() {
|
|||||||
|
|
||||||
# Main method (parses script arguments and calls command_* methods)
|
# Main method (parses script arguments and calls command_* methods)
|
||||||
main() {
|
main() {
|
||||||
OSTYPE="$(uname)"
|
|
||||||
|
|
||||||
COMMAND=""
|
COMMAND=""
|
||||||
set_command() {
|
set_command() {
|
||||||
[[ -z "${COMMAND}" ]] || _exiterr "Only one command can be executed at a time. See help (-h) for more information."
|
[[ -z "${COMMAND}" ]] || _exiterr "Only one command can be executed at a time. See help (-h) for more information."
|
||||||
@@ -633,6 +631,9 @@ main() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Determine OS type
|
||||||
|
OSTYPE="$(uname)"
|
||||||
|
|
||||||
# Check for missing dependencies
|
# Check for missing dependencies
|
||||||
check_dependencies
|
check_dependencies
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user