#!/bin/sh
# BLURB gpl
#
#                            Coda File System
#                               Release 6
#
#           Copyright (c) 1987-2003 Carnegie Mellon University
#                   Additional copyrights listed below
#
# This  code  is  distributed "AS IS" without warranty of any kind under
# the terms of the GNU General Public Licence Version 2, as shown in the
# file  LICENSE.  The  technical and financial  contributors to Coda are
# listed in the file CREDITS.
#
#                         Additional copyrights
#                            none currently
#
#*/

# shellcheck disable=SC2039,SC2145,SC1001,SC3037
echon() {
    if [ "$(echo -n)" ] ; then
        echo "$@"\c
    else
        echo -n "$@"
    fi
}

echo This will permanently remove all Coda volumes from your system.
echon 'This is useful for a clean start. Proceed? [Y/n]: '
read -r yesno

case "$(echo "$yesno" | tr '[:upper:]' '[:lower:]')" in
   y|yes) ;;
   n|no) echo No harm done. ;  exit 1 ;;
   *) ;;
esac

rm -f /vice/db/VRDB /vice/db/VLDB
rm -f /vice/vol/RWList /vice/vol/AllVolumes /vice/vol/VolumeList /vice/db/VRList
echo Volume databases removed.
