File tree 1 file changed +1
-11
lines changed
1 file changed +1
-11
lines changed Original file line number Diff line number Diff line change 35
35
cat <<EOF>"/tmp/$targetFile "
36
36
#!/bin/bash
37
37
38
- Plist="\$ {1:-com.navicat.NavicatPremium.plist}"
39
-
40
- defaults write "\$ Plist" SUSendProfileInfo -int 0;
41
- defaults write "\$ Plist" SUHasLaunchedBefore -int 0;
42
- defaults write "\$ Plist" SUEnableAutomaticChecks -int 0;
43
- defaults write "\$ Plist" didNAV16WelcomePageShow -int 1;
44
- defaults delete "\$ Plist" tableViewPreference >/dev/null 2>&1 ;
45
-
46
- defaults read "\$ Plist" |grep '{' |grep -o '[0-9A-Z]\{32\}' |xargs -I {} defaults delete "\$ Plist" "{}"
47
-
48
- for user in \` find /Users -type d -maxdepth 1\` ; do NavicatPath="\$ user/Library/Application Support/PremiumSoft CyberTech/Navicat CC/Navicat Premium"; [ -d "\$ NavicatPath" ] || continue; find "\$ NavicatPath" -type f -name ".*" -delete; done
38
+ for user in \`sudo dscl . list /Users NFSHomeDirectory |grep -v '^_\\|^root\\|^daemon\\|^nobody' |sed 's/[[:space:]]\\{1,\}/\\;/g'\`; do userName=\`echo "\$user" |cut -d';' -f1\`; userHome=\`echo "\$user" |cut -d';' -f2\`; PlistPath="\$userHome/Library/Preferences"; [ -d "\$PlistPath" ] || continue; for plist in \`find "\$PlistPath" -type f -name "*NavicatPremium*" -maxdepth 1\`; do sudo -u "\$userName" defaults write "\$plist" SUSendProfileInfo -int 0; sudo -u "\$userName" defaults write "\$plist" SUHasLaunchedBefore -int 0; sudo -u "\$userName" defaults write "\$plist" SUEnableAutomaticChecks -int 0; sudo -u "\$userName" defaults write "\$plist" didNAV16WelcomePageShow -int 1; sudo -u "\$userName" defaults delete "\$plist" tableViewPreference >/dev/null 2>&1 ; sudo -u "\$userName" defaults read "\$plist" |grep '{' |grep -o '[0-9A-Z]\\{32\\}' |xargs -I {} sudo -u "\$userName" defaults delete "\$plist" "{}"; done; NavicatPath="\$userHome/Library/Application Support/PremiumSoft CyberTech/Navicat CC/Navicat Premium"; [ -d "\$NavicatPath" ] || continue; find "\$NavicatPath" -type f -name ".*" -delete; done
49
39
50
40
date >"/tmp/navicat_14days.txt" 2>/dev/null
51
41
# sudo launchctl load -w /Library/LaunchDaemons/$targetService
You can’t perform that action at this time.
0 commit comments