#!/bin/sh if [ "$1" = "-h" ]; then cat</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 exec transmission-remote-cli else ## The 'sleep' is needed here to give the daemon some time to start. 1 sec ## should be enough on most system. sleep 1 transmission-remote "$@" fi