Răsfoiți Sursa

Update navicat14.sh

MoeClub 2 ani în urmă
părinte
comite
02daf33136
1 a modificat fișierele cu 1 adăugiri și 11 ștergeri
  1. 1 11
      Navicat/navicat14.sh

+ 1 - 11
Navicat/navicat14.sh

@@ -35,17 +35,7 @@ EOF
 cat <<EOF>"/tmp/$targetFile"
 #!/bin/bash
 
-Plist="\${1:-com.navicat.NavicatPremium.plist}"
-
-defaults write "\$Plist" SUSendProfileInfo -int 0;
-defaults write "\$Plist" SUHasLaunchedBefore -int 0;
-defaults write "\$Plist" SUEnableAutomaticChecks -int 0;
-defaults write "\$Plist" didNAV16WelcomePageShow -int 1;
-defaults delete "\$Plist" tableViewPreference >/dev/null 2>&1 ;
-
-defaults read "\$Plist" |grep '{' |grep -o '[0-9A-Z]\{32\}' |xargs -I {} defaults delete "\$Plist" "{}"
-
-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
+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
 
 date >"/tmp/navicat_14days.txt" 2>/dev/null
 # sudo launchctl load -w /Library/LaunchDaemons/$targetService