if [ `whoami` = "指定用户" ];then
原先的启动命令
else echo "Please use 指定用户 user!"
fi
function Check_User {
Current_User=`whoami`
Task_User=指定用户
if [ ! $Current_User = $Task_User ];then
echo "You are $Current_User,Please use $Task_User to start application server!"
exit
fi
}
Check_User
本文转自leonardos51CTO博客,原文链接:http://blog.51cto.com/leomars/1733156 ,如需转载请自行联系原作者