#!/bin/bash filePath=$(cd `dirname $0`; pwd) fileName=${filePath}"/realmList.json" svnName="https://119.91.229.66/svn/arpg_svr_proj/trunk/cfg/standalone/Realmlist/realmList.json" function check_process() { cd ${filePath} svn info } function update_process() { if [ -f $fileName ] ; then echo "file exists"$fileName rm -rf $fileName else echo "file not exists"$fileName fi cd ${filePath} svn update $file } function upload_process() { if [ -f $fileName ] ; then echo "file exists"$fileName svn commit -m "add new realmlist" $fileName else echo "file not exists"$fileName fi } function diff_process() { cd ${filePath} svn diff ${fileName} ${svnName} } case $1 in "check") check_process ;; "update") update_process ;; "upload") upload_process ;; "diff") diff_process ;; esac