I will give an update on the matter.
I have made a com.startup.plist file in LaunchDaemons.
The file is saved in LaunchDaemons, and it does not work as intended. ( Does not run )
Here is my com.startup.plist file :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:</string>
</dict>
<key>Label</key>
<string>com.startup</string>
<key>Program</key>
<string>/usr/bin/env bash /Users/root/Scripts/startup.sh</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
<key>LaunchOnlyOnce</key>
<true/>
<key>StandardOutPath</key>
<string>/tmp/startup.stdout</string>
<key>StandardErrorPath</key>
<string>/tmp/startup.stderr</string>
<key>UserName</key>
<string>admin</string>
<key>GroupName</key>
<string>admin</string>
<key>InitGroups</key>
<true/>
</dict>
</plist>
The intention of the file is to start a script at boot / startup of laptop.
Script is named : startup.sh
contents of script :
#!/usr/bin/env bash
#Load modules for Fuse
/Library/Filesystems/osxfuse.fs/Contents/Resources/load_osxfuse
/usr/sbin/sysctl -w vfs.generic.osxfuse.tunables.allow_other=1
#Connect to rsync_net
/usr/local/bin/sshfs XXXX@prio.ch-s011.rsync.net: /mnt/sshfs -oauto_cache,reconnect,local,volname=rsync_net,allow_other,defer_permissions
Ok, so the script will not run at startup, because for some reason the com.startup.plist will not run at boot.
Regardless, I am able to run the script by terminal, but ONLY if I give this command in terminal :
Tormods-MacBook-Pro:Scripts tormod$ sudo bash startup.sh
Password:
vfs.generic.osxfuse.tunables.allow_other: 1 -> 1
Tormods-MacBook-Pro:Scripts tormod$
It is impossible to run the script by typing name of script, and enter.
So, some things is working and some things is not working.......
Any help appreciated !