#!/bin/sh get() { echo "title $1" echo "add_tab" if [ "$1" != "/" ]; then echo "title Go to parent directory" echo "url .." echo "thumbnail_url folder.png" echo "thumbnail_size 32x32" echo "add_body_item" fi for f in "$1/"*; do echo "title $f" echo "url $f" if [ -d "$f" ]; then echo "thumbnail_url folder.png" else echo "thumbnail_url file.png" fi echo "thumbnail_size 32x32" echo "add_body_item" done } case "$ACTION" in "get") get "$URL";; *) echo "error unexpected action $ACTION"; exit 1;; esac