#!/bin/bash qfile=/tmp/queue.commands if [ "$1" = "-list" ]; then cat $qfile exit fi echo $* >> $qfile lines=$(cat $qfile | wc -l) if [ $lines -eq 1 ]; then nohup /usr/local/bin/unqueue $qfile & fi