Skip to content

Commit

Permalink
update install scripts
Browse files Browse the repository at this point in the history
* automate more of the nginx setup
* automate the dnsmasq setup
  • Loading branch information
nicknisi committed Jan 17, 2015
1 parent 86c33cb commit 6590eda
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 7 deletions.
8 changes: 1 addition & 7 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions install/link.sh
Original file line number Diff line number Diff line change
@@ -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
41 changes: 41 additions & 0 deletions install/nginx.sh
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.

0 comments on commit 6590eda

Please sign in to comment.