fixed reset when dir is not available; i.e. make only
@@ -168,13 +168,17 @@ foglamp_reset() {
rm -rf ${FOGLAMP_DATA}/logs/*
echo "Removed user data from $FOGLAMP_DATA/logs"
# Remove user data: var
+ if [[ -d "$FOGLAMP_DATA/var" ]]; then
find "$FOGLAMP_DATA/var" -depth -type f -exec rm {} \;
echo "Removed user data from $FOGLAMP_DATA/var"
+ fi
# Remove user data: extras, with one exclusion
find "$FOGLAMP_DATA/extras" -depth -type f -not -name fogbench_sensor_coap.template.json -exec rm {} \;
echo "Removed user data from $FOGLAMP_DATA/extras"
# Remove user etc/kerberos: extras, with one exclusion
+ if [[ -d "$FOGLAMP_DATA/etc/kerberos" ]]; then
find "$FOGLAMP_DATA/etc/kerberos" -depth -type f -not -name "README.rst" -exec rm {} \;
+ fi
# Remove user etc/certs: extras, with exclusions
find "$FOGLAMP_DATA/etc/certs" -depth -type f -not -name user.* -not -name foglamp.* -not -name ca.* -not -name admin.* -exec rm {} \;
# Remove user etc/ files: extras, with one exclusion
