编写了安装脚本
编写了configure.sh方便后期安装
This commit is contained in:
parent
667cfaf7a8
commit
4f506007dc
30
configure.sh
Normal file → Executable file
30
configure.sh
Normal file → Executable file
@ -1,3 +1,29 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# 获取文件夹地址
|
||||||
#
|
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
|
Loading…
Reference in New Issue
Block a user