- removeNHIICC.sh : 移除健保卡元件與相關設定,須以 root (
sudo
) 權限執行。 - postinstall.sh : 官方「MAC 元件移除安裝檔」的 script 內容(2020)
Last active
July 4, 2023 09:34
-
-
Save wancw/61c629b78bad206816ae4b58913a7cd8 to your computer and use it in GitHub Desktop.
移除 macOS 健保卡元件
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
launchctl unload /Library/LaunchDaemons/NHIICC.plist | |
# or "killall macHC" | |
security remove-trusted-cert -d /Library/StartupItems/NHIICC/cert/NHIServerCert.crt | |
security delete-certificate -c NHI.Self.Server.Cert | |
rm -r /Library/StartupItems/NHIICC | |
rm /Library/LaunchDaemons/NHIICC.plist | |
rm -r /usr/local/share/NHIICC | |
rm -r /Users/Shared/share/NHIICC | |
rmdir /Users/Shared/share | |
pkgutil --forget com.NHI.pkg.macInstall | |
sed -i .bak -e '/iccert\.nhi\.gov\.tw/d' /etc/hosts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo killall macHC; | |
sudo rm -R /usr/local/share/NHIICC | |
sudo rm -R /Users/Shared/share/NHIICC | |
sudo rm /Library/StartupItems/NHIICC/NHIICC | |
sudo rm /Library/StartupItems/NHIICC/StartupParameters.plist | |
sudo rm /Library/LaunchDaemons/NHIICC.plist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks, your script has been really helpful. Here are a few updates as I ran it in August 2022
removeHHIICC.sh
NHIICC.plist has been replaced by the two new plists below
#launchctl unload /Library/LaunchDaemons/NHIICC.plist
launchctl remove tw.gov.nhi.nhiicc.plist
launchctl remove tw.gov.nhi.nhiicc2019.plist
security remove-trusted-cert -d /Library/StartupItems/NHIICC/cert/NHIServerCert.crt
security delete-certificate -c NHI.Self.Server.Cert
rm -r /Library/StartupItems/NHIICC
NHIICC.plist has been removed by the two new plists below
#rm /Library/LaunchDaemons/NHIICC.plist
rm /Library/LaunchDaemons/tw.gov.nhi.nhiicc.plist
rm /Library/LaunchDaemons/tw.gov.nhi.nhiicc2019.plist
rm -r /usr/local/share/NHIICC
Run the pkgutil --files command to list all the files installed by the package
pkgutil --files gov.nhi.macHC
rm -r /Users/Shared/share/NHIICC
rm -r /Users/Shared/share
The package name has been changed to gov.nhi.macHC
#pkgutil --forget com.NHI.pkg.macInstall
pkgutil --forget gov.nhi.macHC
The following is no longer needed
#sed -i .bak -e '/iccert.nhi.gov.tw/d' /etc/hosts