| 1 | #! /bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | ########################################################################### |
| 3 | # LinPac - packet radio terminal for Linux |
| 4 | # (c) 1999 Radek Burget <[email protected]> |
| 5 | # |
| 6 | # This script provides the user interface for delmsg.pl |
| 7 | # |
| 8 | # Usage: delmsg <message_number> [<message_number> ...] |
| 9 | ########################################################################### |
| 10 | |
| 11 | #lpapi should be in PATH when LinPac is running |
| 12 | LPAPI="lpapi" |
| 13 | |
| 14 | #Check parametres |
| 15 | if [scip-shell system . . `[`. ! $# -gt 0 ]; then |
| 16 | echoscip-shell system . . echo. 'Usage: delmsg <message_number> [<message_number> ...]' |
| 17 | exit 1 |
| 18 | fi |
| 19 | |
| 20 | #Test if LinPac is running |
| 21 | $LPAPI 0 |
| 22 | if [scip-shell system . . `[`. ! $? -eq 0 ]; then |
| 23 | echoscip-shell system . . echo. LinPac is not running |
| 24 | exit 1 |
| 25 | fi |
| 26 | |
| 27 | #Get the home BBS address |
| 28 | HOMEADDR=`$LPAPI 0 get HOME_ADDR` |
| 29 | |
| 30 | #Get the callsign |
| 31 | TTT=`echoscip-shell system . . echo. $HOMEADDR | trscip-shell system . . tr. "." ","` |
| 32 | CALL=`echoscip-shell system . . echo. $TTT | sedscip-shell system . . sed. s/,.*//` |
| 33 | |
| 34 | #Call delmsg.pl with all the message numbers |
| 35 | for I; do |
| 36 | delmsg.pl $CALL $I |
| 37 | done |