diff --git a/configure.sh b/configure.sh old mode 100644 new mode 100755 index b2aa584..c85e974 --- a/configure.sh +++ b/configure.sh @@ -1,3 +1,29 @@ #!/bin/bash - -# \ No newline at end of file +# 获取文件夹地址 +folderAddress=`pwd` +# 指定安装地址 若不存在则建立 同时将路径添加到环境变量中 +objectAddress="/usr/local/sbin" +if [[ ! -d $objectAddress ]]; then + mkdir $objectAddress + export PATH=$PATH:$objectAddress + #找到所有gmt开始的脚本名称 存入数组 + scriptName=( `ls gmt*` ) + for element in ${scriptName[@]}; do + objectName=${element%.*} + printf "creating links for "$objectName"... " + ln -s ${folderAddress}/${element} ${objectAddress}/${objectName} + printf "done\n" + done +else + #找到所有gmt开始的脚本名称 存入数组 + scriptName=( `ls gmt*` ) + for element in ${scriptName[@]}; do + objectName=${element%.*} + #若链接不存在 则建立 + if [[ ! -L ${objectAddress}/${objectName} ]]; then + printf "creating links for "$objectName"... " + ln -s ${folderAddress}/${element} ${objectAddress}/${objectName} + printf "done\n" + fi + done +fi \ No newline at end of file diff --git a/sph_global_dot.sh b/gmtsph-global-dot.sh similarity index 100% rename from sph_global_dot.sh rename to gmtsph-global-dot.sh