2013-12-01 13:26:21 -08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2013-12-02 10:25:44 -08:00
|
|
|
source ~/.dotfiles/zsh/functions
|
|
|
|
|
2013-12-01 13:26:21 -08:00
|
|
|
BASEDIR=$(dirname "$0")
|
|
|
|
|
|
|
|
$BASEDIR/python
|
|
|
|
pip install flexget
|
|
|
|
pip install transmissionrpc
|
|
|
|
|
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
case "$1" in
|
2013-12-02 10:24:09 -08:00
|
|
|
"--daemon")
|
2013-12-01 13:26:21 -08:00
|
|
|
if is_mac; then
|
|
|
|
brew install transmission
|
2013-12-02 10:24:09 -08:00
|
|
|
|
|
|
|
plistf="~/Library/LaunchAgents/com.flexget.plist"
|
|
|
|
if [ ! -f "$plistf" ]; then
|
|
|
|
cat <<-EOF > "$plistf"
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
|
|
<plist version="1.0">
|
|
|
|
<dict>
|
|
|
|
<key>Label</key>
|
|
|
|
<string>com.flexget</string>
|
|
|
|
<key>ProgramArguments</key>
|
|
|
|
<array>
|
|
|
|
<string>/usr/local/bin/flexget</string>
|
|
|
|
<string>--cron</string>
|
|
|
|
</array>
|
|
|
|
<key>Nice</key>
|
|
|
|
<integer>1</integer>
|
|
|
|
<key>StartInterval</key>
|
|
|
|
<integer>900</integer>
|
|
|
|
<key>RunAtLoad</key>
|
|
|
|
<true/>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
|
|
|
|
launchctl load -w "$plistf"
|
|
|
|
mkdir -p ~/.flexget
|
|
|
|
vim ~/.flexget/config.yml
|
2013-12-01 13:26:21 -08:00
|
|
|
elif is_deb; then
|
|
|
|
sudo add-apt-repository ppa:transmissionbt/ppa
|
|
|
|
pkg_install transmission-cli transmission-daemon transmission-common
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|