From 6590edaf82f8c4772386cbc6705a7b18f61322bb Mon Sep 17 00:00:00 2001 From: Nick Nisi Date: Sat, 17 Jan 2015 02:57:20 -0600 Subject: [PATCH] update install scripts * automate more of the nginx setup * automate the dnsmasq setup --- install.sh | 8 +------ {scripts => install}/brew.sh | 0 install/link.sh | 11 +++++++++ install/nginx.sh | 41 +++++++++++++++++++++++++++++++++ scripts/osx.sh => installosx.sh | 0 5 files changed, 53 insertions(+), 7 deletions(-) rename {scripts => install}/brew.sh (100%) create mode 100755 install/link.sh create mode 100755 install/nginx.sh rename scripts/osx.sh => installosx.sh (100%) diff --git a/install.sh b/install.sh index 26cf778c4..41295be87 100755 --- a/install.sh +++ b/install.sh @@ -5,13 +5,7 @@ echo "installing dotfiles" echo "initializing submodule(s)" git submodule update --init --recursive -echo "creating symlinks" -linkables=$( ls -1 -d **/*.symlink ) -for file in $linkables ; do - target="$HOME/.$( basename $file ".symlink" )" - echo "creating symlink for $file" - ln -s $file $target -done +source install/link.sh if [ "$(uname)" == "Darwin" ]; then echo "running on OSX" diff --git a/scripts/brew.sh b/install/brew.sh similarity index 100% rename from scripts/brew.sh rename to install/brew.sh diff --git a/install/link.sh b/install/link.sh new file mode 100755 index 000000000..158db7b8b --- /dev/null +++ b/install/link.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +DOTFILES=$HOME/.dotfiles + +echo "creating symlinks" +linkables=$( ls -1 -d **/*.symlink ) +for file in $linkables ; do + target="$HOME/.$( basename $file ".symlink" )" + echo "creating symlink for $file" + ln -s $DOTFILES/$file $target +done diff --git a/install/nginx.sh b/install/nginx.sh new file mode 100755 index 000000000..64f64ca38 --- /dev/null +++ b/install/nginx.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +###################################################### +# nginx setup +###################################################### + +$DOTFILES=$HOME/.dotfiles + +echo "Installing nginx" + +# first, make sure apache is off +sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist + +# run nginx when osx starts +sudo cp /usr/local/opt/nginx/homebrew.mxcl.nginx.plist /Library/LaunchDaemons +launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist + +mkdir -p /usr/local/etc/nginx/sites-enabled +cp -R nginx/sites-available /usr/local/etc/nginx/sites-available +mv /usr/local/etc/nginx/nginx.conf /usr/local/etc/nginx/nginx.conf.orig +ln -s $DOTFILES/nginx/nginx.conf /usr/local/etc/nginx/nginx.conf + +sites=$( ls -1 -d $DOTFILES/nginx/sites-available) +for site in $sites ; do + echo "linking $site" + ln -s $DOTFILES/nginx/sites-available/$site /usr/local/etc/nginx/sites-enabled/$site +done + + +###################################################### +# dnsmasq setup +###################################################### + +echo "installing dnsmasq" + +# move dnsmasq config into place +ln -s $DOTFILES/nginx/dnsmasq.conf /usr/local/etc/ + +# setup dnsmasq +sudo cp -fv /usr/local/opt/dnsmasq/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons +sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq diff --git a/scripts/osx.sh b/installosx.sh similarity index 100% rename from scripts/osx.sh rename to installosx.sh