Shell script for reloading macports
If you're on OSX and you use macports, it can get really tedious to stop and start webservers or database servers:
sudo port unload nginx
sudo port load nginx
Here's a bash script to simplify things:
#!/usr/bin/env bash
SUDO="/usr/bin/sudo"
PORT="/opt/local/bin/port"
if [ $# -lt 1 ]; then
echo "Usage: portreload portname [portname] ...";
exit;
fi
for p in $@
do
$SUDO $PORT unload $p \
&& $SUDO $PORT load $p \
&& echo "Port $p reloaded";
done
Now you can just do:
portreload nginx php54-fpm mysql5
http://future500.nl/how-to-reload-macports-without-unload-load/
Written by Ramon de la Fuente
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#