Execute .sh in GUI without chmod +x

patkitchen

Registered
**i originally posted this in the scripting forum but theres only been a handful of posts there this year, this board's a bit faster.**

So, I'll have to provide some background info so you know what's going on. I'm setting up a preconfigured .conf for Viscosity (OpenVPN). What my sh script does is copies all the pertinent files to the correct folders and runs sed to customize it for the particular user. Normally you'd just chmod +x it to make it executable..in this situation EVERYTHING needs to be rolled up into one click as this will be distributed to 'uninformed' users and needs to be foolproof.

I've tried "sh->app" rollers such as platypus and they suck and only run half of my script at best.

So experts, I Ask, how does one make a self-contained, executable .sh script that can be distributed and executed on multiple computers without ANY user intervention beyond "download this and double click it"

Thanks in advance,

Pat
 
I don't think it'd be too bad... perhaps one of the geniuses here (NixGeek, Captain Code, etc.) that are more familiar with creating GUI programs can assist you.

I know for someone with XCode experience that it would be a 5-minute operation.
 
Hm, well if its a 5 minute operation for the experienced would someone experienced mind helping me out?

Here's the code.

pastebin.com/m61c8b013
or
#! /bin/sh
export WHOAMI=$(whoami)
unzip /Users/$WHOAMI/Desktop/caseware_rdvpn_mac.zip -d /Users/$WHOAMI/Library/openvpn/
rm -rf /Users/$WHOAMI/Library/openvpn/__MACOSX/
sed "s/zebra/$WHOAMI/g" /Users/$WHOAMI/Library/openvpn/caseware_rdvpn_mac.template > /Users/$WHOAMI/Library/openvpn/caseware_rdvpn_mac.conf
 
If all the Mac users are using Leopard (and it may work under Tiger, too), then you could possibly create an Automator action to do what you need. Here's an Apple tutorial on taking a shell script and making an Automator action out of it:

http://developer.apple.com/appleapplications/transformscriptintoaction.html

It requires XCode as well, but XCode is a free download (albeit a LARGE download) if you sign up for a free Apple Developer Connection account.
 
Back
Top