#!/bin/bash

ID=`/usr/bin/id -u`
        [ $ID -ne 0 ]  && echo "You must sudo to run $0." && exit
echo "Enter Shop Code:"
read -p ""
SHOPCODE=$REPLY
if [ ${#SHOPCODE} != 8 ] ; then
echo "Shop Code must be 8 characters."
exit
fi
if [ -d /backups/tfrsync-$SHOPCODE ] ; then
echo "Is Subscriber? y/n"
read -p ""
if [ "$REPLY" == "y" ] ; then
touch /backups/tfrsync-$SHOPCODE/paying_customer
echo "Cloud account tfrsync-$SHOPCODE is now a subscriber."
else
rm -f /backups/tfrsync-$SHOPCODE/paying_customer
echo "Cloud account tfrsync-$SHOPCODE is now not a subscriber."
fi
exit
else
echo "Cloud account doesn't exist."
fi
