add a script to set up Linky on a new machine
This commit is contained in:
parent
fac09e8991
commit
269e8c803b
1 changed files with 26 additions and 0 deletions
26
linky-setup.sh
Executable file
26
linky-setup.sh
Executable 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!"
|
||||||
Loading…
Reference in a new issue