update jpom-service.sh

This commit is contained in:
idiotalex@163.com 2021-04-19 16:47:54 +08:00
parent cf2a936d55
commit 7af6db550d

View File

@ -1,4 +1,9 @@
#!/bin/bash
ROOT_PATH="$1"
FILE_NAME="$2"
echo '#!/bin/bash
# chkconfig: 356 10 90
# description: Jpom-Server service
# processname: jpom-server
@ -21,36 +26,34 @@
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' > $FILE_NAME
# make sure sh could load enviroment variables, in particular, in the init.d directory
source /etc/profile
echo '# make sure sh could load enviroment variables, in particular, in the init.d directory
source /etc/profile' >> $FILE_NAME
ROOT_PATH="$1"
# 启动程序
echo "# 启动程序
function start() {
$ROOT_PATH/Server.sh start
}
}" >> $FILE_NAME
# 停止程序
echo "# 停止程序
function stop() {
$ROOT_PATH/Server.sh stop
status
}
}" >> $FILE_NAME
# 获取程序状态
echo "# 获取程序状态
function status() {
$ROOT_PATH/Server.sh status
}
}" >> $FILE_NAME
# 提示使用语法
echo '# 提示使用语法
function usage() {
echo "Usage: $0 {start|stop|restart|status|create}"
RETVAL="2"
}
}' >> $FILE_NAME
# See how we were called.
echo '# See how we were called.
RETVAL="0"
case "$1" in
start)
@ -71,4 +74,4 @@ case "$1" in
;;
esac
exit $RETVAL
exit $RETVAL' >> $FILE_NAME