You can put this line in your 'go' script before invoking 'emhttp':
rm /etc/avahi/services/smb.service
This just removes the service definition file for smb under avahi. Now Finder won't see it automatically but it would be interesting to see under Lion if you can connect to AFP via Finder sidebar as usual, and then also connect using "Connect to Server" method to same share using smb.
If you look inside that smb.service file you'll see it's pretty simple. Maybe there's another way to same server show up in Finder sidebar with both protocols enabled.
If I remove the smb.service file I can no longer connect to afp via Finder Sidebar. The entry for afp is there, but the shares are mounted using smb. Connect to server works as expected.
So are you saying this:
1. With smb.service file removed, the server still shows up in sidebar because AFP is enabled.
2. If you click on your server in the sidebar, it works, but then you can't connect via smb.
3. Alternately, if you connect via smb, it now won't work to click on your server in the sidebar.
All above correct?
1. Correct, the server without the -SMB prefix is still in the sidebar since afp service is enabled.
2. If I click the server in the sidebar, it works but connects using smb and not afp.
3. Not sure if I follow, but both the sidebar and connect to server work, but both use smb.