#!/bin/bash # this is a shell script meant to run in tandem with a server side # php script allowing it to be accessed and updated from a bash shell # requires lynx and some customization # url of php script for example http://your.site/td/ URL= # username and password for http_auth if .htaccess protected ID= PW= # location of lynx LOC=/sw/bin/lynx # nothing past here should need to be altered # if no input display list if [ -e $1 ] then echo -e "\n$URL\n" $LOC -dump -auth=$ID:$PW -hiddenlinks=ignore -nolist $URL echo else # if input -h print help if [ "$1" = "-h" ] then echo -e "\n SYNOPSIS:" echo -e " td [-line_number or post]\n" echo " EXAMPLES:" echo " td // lists items" echo " td -17 // deletes line 17" echo -e " td \"this is a post\" // adds a new item" echo -e " td -h // displays this help message\n" else # else add or delete item echo -e "\n$URL\n" $LOC -dump -auth=$ID:$PW -hiddenlinks=ignore -nolist $URL?$1 echo fi fi