#!/bin/sh
# Remove an ID from the list
if [ $# -lt 1 ]
then
echo -e "Usage: $0 ID\n"
exit
elif [ $# -gt 1 ]
then
echo -e "Usage: $0 ID\n"
exit
else
if [ $1 -gt 9999 ]
then
echo -e "ID must be between 1-9999\n"
exit
elif [ $1 -lt 10 ]
then
ID="000$1"
elif [ $1 -lt 100 ]
then
ID="00$1"
elif [ $1 -lt 1000 ]
then
ID="0$1"
else
ID="$1"
fi
# ------------------------
echo "Removing $ID from ID list"
cp -f /etc/IDs /etc/IDs1
cat /etc/IDs1 | grep -v "$ID" > /etc/IDs
rm -f /etc/IDs1
fi