I do not have any Linux to test with but below are some comments.

 Code:
If Left(@WKSTA, 6) = "be_105"
....


Will return the first 6 characters of the machine the script is running on. The TS in your case. If you need the client computername (the workstation the users is behind) you could use ExpandEnvironmentVars(%clientname%)instead of @WKSTA.

The else is not needed if there is no code required there. Deleting a printer connection, creating it and making it default is one way of getting it done. Depending on personal preference it is also an option to check if the printer is there and set it or not depending on the results. I use the function PriMapState for that. This function is available in the UDF library.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.