Running full linux in my home for kodi. I have a shared mysql db running and I just figured out path subsititution so I now have a shared playlists folder on my nfs share. My question is, rather than having a different advancedsettings.xml for each user on the system can I have a single one that imports $USER to the proper place? Not sure this is possible. Below is what I'm looking for, or similar. Some way to get current user into the file when it is parsed. Can this be done, or should I just maintain separate files for each user?
*EDIT* Solved. Didn't think to write a wrapper script to start it.
This was original desire.
*EDIT* Solved. Didn't think to write a wrapper script to start it.
Code:
if [[ "$USER" == kodi* ]] ; then
if ! grep "$USER" /home/"$USER"/.kodi/userdata/advancedsettings.xml ; then
sed -i "s/$(grep from /home/${USER}/.kodi/userdata/advancedsettings.xml | awk -F\/ '{print $3}')/${USER}/" /home/"$USER"/.kodi/userdata/advancedsettings.xml
fi
kodi-standalone
fi
This was original desire.
Code:
<pathsubstitution>
<substitute>
<to>nfs://failbox.mylan.home/snapraid/pool/kodiplaylists/</to>
<from>/home/"$USER"/.kodi/userdata/playlists/</from>
</substitute>
</pathsubstitution>