#!/bin/bash
#------------------------------------------------
#scvconf for scvbin's commands
#/var/www/html/scv/.scvconf を編集
#------------------------------------------------
usage() {
  echo "scv config editor 1.1"
  echo "scvconf -show   ;show scvconf"
  echo "scvconf -nano   ;edit scvconf using nano editor"
  echo "scvconf -vi     ;edit scvconf using vi editor"
  exit 1
}

#------------------------------------------------
PCOUNT=$#
if [ $PCOUNT -eq 0 ]; then
  usage
fi

CONF="/var/www/html/scv/.scvconf"

if [ -e $CONF ]; then
  :
else
  echo "$CONF file not found!"
  exit 1
fi

case "${1}" in
  "-show" ) sudo less $CONF ;;
  "-nano" ) sudo nano $CONF ;;
  "-vi"   ) sudo vi $CONF ;;
  * ) usage ;;
esac

exit 0
#eof

