add a script to set up Linky on a new machine

This commit is contained in:
Sami Samhuri 2017-02-21 09:10:31 -08:00
parent fac09e8991
commit 269e8c803b
No known key found for this signature in database
GPG key ID: F76F41F04D99808F

26
linky-setup.sh Executable file
View file

@ -0,0 +1,26 @@
#!/bin/bash
set -e
if ! which northwatcher >/dev/null 2>/dev/null; then
npm install -g northwatcher
fi
machine_name=$(hostname -s)
mkdir -p $HOME/Dropbox/Apps/Linky/$machine_name/Archive
cp $HOME/Dropbox/Apps/Linky/net.samhuri.northwatcher.plist $HOME/Library/LaunchAgents
if [[ ! -e $HOME/.northwatcher ]]; then
echo "+ Dropbox/Apps/Linky/$machine_name ruby /Users/sjs/bin/linky-notify" >$HOME/.northwatcher
fi
if [[ ! -e /var/log/northwatcher.log ]]; then
echo "Enter your password to create /var/log/northwatcher.log."
sudo touch /var/log/northwatcher.log
sudo chown sjs:staff /var/log/northwatcher.log
fi
launchctl load $HOME/Library/LaunchAgents/net.samhuri.northwatcher.plist
echo "* Linky is set up!"