#!/bin/sh
#
# fix-cache
#
# script to unpin any pinned cache

P=/usr/share/venusd/EXEC

# 
# look for pinned cache, indicated by NR string or WT string
# ideally: should be R and AWB
#
$P/storcli /c0 show | grep "^[0-9]/[0-9]" | grep "NR\|WT" | while read A B C D E M X; do
	V=${A:2:1}
	echo "VD$V is pinned: mode $M"
	echo "storcli /c0/v$V delete preservedcache"
	$P/storcli /c0/v$V delete preservedcache
done
sleep 1
#
# now log anything else
#
$P/storcli /c0 show | grep "^[0-9]/[0-9]" | while read A B C D E M X; do
        V=${A:2:1}
        echo "VD$V is now mode $M"
done



