mdserver-web/plugins/php/versions/common.sh

51 lines
1.3 KiB
Bash
Raw Permalink Normal View History

2022-07-09 04:12:12 -04:00
#!/bin/bash
2023-11-08 12:32:59 -05:00
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin
2023-11-10 05:47:32 -05:00
export PATH=$PATH:/opt/homebrew/bin
2022-07-09 04:12:12 -04:00
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
version=$1
action=$2
extName=$3
# echo $1,$2,$3
# echo $curPath
# echo $rootPath
# echo $serverPath
FILE=${curPath}/${version}/${extName}.sh
FILE_COMMON=${curPath}/common/${extName}.sh
if [ "$action" == 'install' ];then
if [ -f $FILE ];then
cd ${curPath}/${version} && bash ${extName}.sh install ${version}
elif [ -f $FILE_COMMON ];then
cd ${curPath}/common && bash ${extName}.sh install ${version}
else
echo 'no such extension'
fi
fi
if [ "$action" == 'uninstall' ];then
if [ -f $FILE ];then
2022-07-13 07:36:38 -04:00
cd ${curPath}/${version} && bash ${extName}.sh uninstall ${version}
2022-07-09 04:12:12 -04:00
elif [ -f $FILE_COMMON ];then
2022-07-13 07:36:38 -04:00
cd ${curPath}/common && bash ${extName}.sh uninstall ${version}
2022-07-09 04:12:12 -04:00
else
echo 'no such extension'
fi
fi
echo "cd ${curPath}/common && bash ${extName}.sh install ${version}"
echo "cd ${curPath}/${version} && bash ${extName}.sh install ${version}"
2022-07-13 07:36:38 -04:00
echo "cd ${curPath}/common && bash ${extName}.sh uninstall ${version}"
echo "cd ${curPath}/${version} && bash ${extName}.sh uninstall ${version}"