You could try "automated" procedure anyway I think - at the beginning of it I take print of partition table, calculate MD5 on it and compare it with MD5 of "pristine" partition tables known to me. If partitions were modified in a way unknown to me - procedure would not do anything. So it should be harmless to try - even for second hand device.
Something like this:
Code:
CHECK=`parted -s /dev/mmcblk2 unit s print | tail -n 11 | head -n 10 | md5sum | awk '{ print $1 }'`
if [ "${CHECK}" != "23d3bacd2772baa47a19379e1f4bc84f" -a "${CHECK}" != "601f19a43444ef303bc0a4b81b557272" ]
then
echo -e "ERROR: Device has wrong partitioning, exiting immediatly ${CHECK}\n" >> $W_LOG