#!/bin/sh
# persistVariable demo script
# 
#    arg 1 is operation, read, update, verify, delete
#    arg 2 is NAME, or NAME=VALUE

persistVariable update bashName=5
ret=$?
if [ $ret -eq 0 ]
then
    persistVariable verify bashName=5
    ret=$?
    if [ $ret -eq 0 ]
    then
        persistVariable read bashName
        ret=$?
        echo "persistVariable of variable 'bashName' succeeded with value $ret"
    else
        echo "persist bashName variable failed to verify"
        addLogRecord persistVariableDemo.sh ERROR "bashName failed to verify"
    fi
    #cleanup demo variable
    persistVariable delete bashName
else
    echo "persistVariable failed save bashName"
    addLogRecord persistVariableDemo.sh ERROR "persistVariable failed save bashName"
fi
