trc: transmission wrapper for remote and remote-cli

master
Pierre Neidhardt 2014-01-04 20:33:49 +01:00
parent e32bc824ca
commit 2c258b7c39
1 changed files with 20 additions and 0 deletions

20
.scripts/trc Executable file
View File

@ -0,0 +1,20 @@
#!/bin/sh
check()
{
for i ; do
if ! command -v $i >/dev/null 2>&1; then
echo >&2 "'$i' not found in PATH. Exiting."
exit 1
fi
done
}
check transmission-daemon transmission-remote-cli
[ $(ps -U $USER | grep -c transmission-da) -eq 0 ] && transmission-daemon
if [ $# -eq 0 ]; then
transmission-remote-cli
else
transmission-remote "$@"
fi