480c09e328f794fdc3b1bb2b5b3803c35385ae43 max Tue Jul 15 02:37:36 2014 -0700 Adding scripts for Windows/OSX that create the network name "genome.ucsc.local", rm #12843 diff --git src/browserbox/clientInstall/addLocalMac.applescript src/browserbox/clientInstall/addLocalMac.applescript new file mode 100644 index 0000000..ea09f27 --- /dev/null +++ src/browserbox/clientInstall/addLocalMac.applescript @@ -0,0 +1,46 @@ +# UCSC Browserbox install helper script +display dialog "UCSC Browserbox network config helper: This program adds an entry 'ucsc.local' to your network configuration (/etc/hosts) and directs port 1234 to it. To do this, you will need the adminstrator password" +do shell script "if grep -q ucsc.local /etc/hosts ; then true; else echo 127.0.0.1 genome.ucsc.local; fi >> /etc/hosts" with administrator privileges +# flush the DNS cache to activate the localhost entry +do shell script "dscacheutil -flushcache" + +# setup a plist file to create firewall rule on every reboot that redirects local host 1234 to port 80 +set plistStr to " + + + + Label + edu.ucsc.genome.portRedir + ProgramArguments + + /sbin/ipfw + add + 100 + fwd + 127.0.0.1,1234 + tcp + from + any + to + me + 80 + + RunAtLoad + + Nice + 10 + KeepAlive + + AbandonProcessGroup + + + +" +# create the plist file for the firewall rule +do shell script "echo " & quoted form of plistStr & " > /System/Library/LaunchDaemons/edu.ucsc.genome.portRedir.plist" with administrator privileges + +# activate the plist file now +do shell script "launchctl load /System/Library/LaunchDaemons/edu.ucsc.genome.portRedir.plist" with administrator privileges + +#do shell script "ipfw add 100 fwd 127.0.0.1,1234 tcp from any to me 80" with administrator privileges +display dialog "Added entry for genome.ucsc.local to hosts file. Redirected port 80 to port 1234, by creating the file /System/Library/LaunchDaemons/edu.ucsc.genome.portRedir.plist which is run on every reboot" buttons "OK" default button "OK"