#!/bin/bash

DATE=`date +%Y-%m-%d`

if [ -d ~/Library/Application\ Support/Metaverse ];then
    echo " ==== Metaverse Wallet found. ==="
    echo " ==== $DATE ==="
    echo " ==== START BACKUP ... ==== "
    BACKUP="mainnet.$DATE"
    mv -f ~/Library/Application\ Support/Metaverse/mainnet ~/Library/Application\ Support/Metaverse/$BACKUP
    echo " ==== BACKUP as $BACKUP DONE ... ==== "
    echo " ==== START RESET ... ==== "
    mvsd -i
    cp -rf ~/Library/Application\ Support/Metaverse/$BACKUP/account* ~/Library/Application\ Support/Metaverse/mainnet/
    echo " ==== ALL DONE, YOU CAN START FROM height 0 NOW ==== "
fi
