2022-07-03 06:01:51 -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-03 06:01:51 -04:00
|
|
|
|
|
|
|
|
curPath=`pwd`
|
|
|
|
|
rootPath=$(dirname "$curPath")
|
|
|
|
|
rootPath=$(dirname "$rootPath")
|
|
|
|
|
rootPath=$(dirname "$rootPath")
|
2022-08-06 00:47:07 -04:00
|
|
|
rootPath=$(dirname "$rootPath")
|
2022-07-03 06:01:51 -04:00
|
|
|
serverPath=$(dirname "$rootPath")
|
|
|
|
|
|
2022-07-03 06:21:48 -04:00
|
|
|
version=$1
|
|
|
|
|
action=$2
|
2022-07-03 06:01:51 -04:00
|
|
|
|
|
|
|
|
if [ -f /lib/systemd/system/php${version}.service ];then
|
|
|
|
|
systemctl ${action} php${version}
|
2022-08-06 00:47:07 -04:00
|
|
|
elif [ -f /usr/lib/systemd/system/php${version}.service ]; then
|
2022-07-03 12:16:37 -04:00
|
|
|
systemctl ${action} php${version}
|
2022-07-03 06:01:51 -04:00
|
|
|
else
|
|
|
|
|
$serverPath/php/init.d/php${version} ${action}
|
|
|
|
|
fi
|