diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e539de --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +._* \ No newline at end of file diff --git a/hidpi.sh b/hidpi.sh index fccfb69..08f36c6 100755 --- a/hidpi.sh +++ b/hidpi.sh @@ -1,6 +1,6 @@ #!/bin/sh -sipChecker=($(csrutil status | awk '{ print $5 }')) +sipInfo=("$(csrutil status)") systemVersion=($(sw_vers -productVersion | cut -d "." -f 2)) systemLanguage=($(locale | grep LANG | sed s/'LANG='// | tr -d '"' | cut -d "." -f 1)) @@ -68,9 +68,11 @@ downloadHost="https://raw.githubusercontent.com/xzhih/one-key-hidpi/master" # downloadHost="https://raw.githubusercontent.com/xzhih/one-key-hidpi/dev" # downloadHost="http://127.0.0.1:8080" -if [ "${sipChecker}" != "disabled." ]; then - echo "${disableSIP}"; - exit 0 +if [[ "${sipInfo}" == *"Filesystem Protections: disabled"* ]] || [[ "$(awk '{print $5}' <<< "${sipInfo}")" == "disabled." ]]; then + : +else + echo "${disableSIP}"; + exit 0 fi if [[ "${systemVersion}" -ge "15" ]]; then