Skip to content

Instantly share code, notes, and snippets.

@wancw
Last active July 4, 2023 09:34
Show Gist options
  • Save wancw/61c629b78bad206816ae4b58913a7cd8 to your computer and use it in GitHub Desktop.
Save wancw/61c629b78bad206816ae4b58913a7cd8 to your computer and use it in GitHub Desktop.
移除 macOS 健保卡元件

檔案說明

  • removeNHIICC.sh : 移除健保卡元件與相關設定,須以 root (sudo) 權限執行。
  • postinstall.sh : 官方「MAC 元件移除安裝檔」的 script 內容(2020)
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
#!/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
@wancw
Copy link
Author

wancw commented Aug 29, 2022

@10chu Thanks for the update, I will make a new version later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment