#!/bin/sh publish() { echo "I'm a publish function" } foobar() { echo "I'm a foobar function" } usage() { echo "Sorry, I can only undestand the following commands:" echo " - publish publishes something to somehere" echo " - foobar makes you feel warm and fuzzy" exit 2 } case "$SSH_ORIGINAL_COMMAND" in "publish") publish; ;; "foobar") foobar; ;; *) usage; ;; esac