Date: | 07 April 2020 |
---|---|
license: | BSD-3-Clause |
Currently the student/school application Istation.app (version 2.5 at the time of writing) uses the system-level cache (/Library/Caches) to store user data. This means that a computer with two accounts where the users attend different schools have to reconfigure the app every time they use it.
This script can be wired up as a macOS LoginHook to make it use the user cache (~/Library/Caches) to save that constant reconfiguration.
Note
This script will delete the files at /Library/Caches/com.istation.isapp. That should not be a problem as they are temporary files. If for some reason you don't like that, modify the script or save them beforehand.
Place script, somewhere like /Library/Scripts/istation-fix
Ensure script has executable permissions by all users:
sudo chown root:admin /Library/Scripts/istation-fix sudo chmod 755 /Library/Scripts/istation-fix
Install it as a LoginHook:
sudo defaults write com.apple.loginwindow LoginHook /Library/Scripts/istation-fix
Now the script will run any time a user logs in.
Note
Two users should not have the Istation.app open at the same time, which is possible if using macOS fast-user switching.
sudo defaults delete com.apple.loginwindow LoginHook
sudo rm /Library/Scripts/istation-fix