{"id":1598,"date":"2021-05-28T02:36:54","date_gmt":"2021-05-27T18:36:54","guid":{"rendered":"https:\/\/www.wjxy.net.cn\/?p=1598"},"modified":"2023-10-04T06:32:36","modified_gmt":"2023-10-03T22:32:36","slug":"linux-%e4%b8%80%e9%94%ae%e9%83%a8%e7%bd%b2kms%e6%9c%8d%e5%8a%a1%e5%99%a8%e8%84%9a%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/www.wjxy.net.cn\/?p=1598","title":{"rendered":"linux \u4e00\u952e\u90e8\u7f72kms\u670d\u52a1\u5668\u811a\u672c"},"content":{"rendered":"<p>\u6e90\u81eagit hub\uff1adakkidaze\/one-key-kms<\/p>\n<p>https:\/\/github.com\/Wind4\/vlmcsd<br \/>\ncentos \u5b89\u88c5\uff1a<\/p>\n<h3>\u4e0b\u8f7d\uff1a<a href=\"https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2021\/05\/vlmcsd.tar\">vlmcsd<\/a><\/h3>\n<p><code>#! \/bin\/bash<br \/>\n#One-key-kms script by Dakkidaze &lt;gioku@docomo.net.cn&gt;<br \/>\nPATH=\/bin:\/sbin:\/usr\/bin:\/usr\/sbin:\/usr\/local\/bin:\/usr\/local\/sbin:~\/bin<br \/>\nexport PATH<br \/>\nclear<br \/>\nstart(){<br \/>\nyum install gcc git make -y<br \/>\nmkdir \/usr\/local\/kms<br \/>\ncd \/usr\/local\/kms<br \/>\ngit clone https:\/\/github.com\/Wind4\/vlmcsd.git<br \/>\ncd vlmcsd<br \/>\nmake<br \/>\ncd bin<br \/>\nmv vlmcsd \/usr\/local\/kms\/kms<br \/>\ncd \/usr\/local\/kms\/<br \/>\nrm -rf .\/vlmcsd\/<br \/>\nmv kms vlmcsd<br \/>\nclear<br \/>\necho \"Succeeded.\"<br \/>\necho \"The executable file lies in \/usr\/local\/kms\/\"<br \/>\necho \"Remember that the server is not running right now.\"<br \/>\necho \"Please use -h to find possible usage for the executable or visit vlmcsd on Github.\"<br \/>\necho \"https:\/\/github.com\/Wind4\/vlmcsd\"<br \/>\necho \"Addtionally, you may want to get a script to manage it.\"<br \/>\necho \"In this case, you may download a script at the one-key-kms repository.\"<br \/>\necho \"Thanks for your using!\"<br \/>\necho \"Dakkidaze &lt;gioku@docomo.net.cn&gt;\"<br \/>\n}<br \/>\necho \"This script will automatically download and compile KMS Server program for you.\"<br \/>\necho \"For more information, please visit https:\/\/github.com\/Wind4\/vlmcsd\"<br \/>\necho \"Scrpit written by Dakkidaze &lt;gioku@docomo.net.cn&gt;\"<br \/>\necho \"READY TO START?\"<br \/>\nread -p \"y\/n:\" choice<br \/>\ncase $choice in<br \/>\n\"y\")<br \/>\nstart<br \/>\n;;<br \/>\n\"n\")<br \/>\nexit 0;<br \/>\n;;<br \/>\n*)<br \/>\necho \"Please enter y or n!\"<br \/>\n;;<br \/>\nesac<br \/>\n<\/code><\/p>\n<h3>\u8fd0\u884c\uff1a<\/h3>\n<p><code><br \/>\n#!\/bin\/bash<br \/>\n# Author: Dakkidaze &lt;gioku@docomo.net.cn<br \/>\nDAEMON=\/usr\/local\/kms\/vlmcsd<br \/>\nSTAT=2<br \/>\ncheck_running(){<br \/>\nPID=`ps -ef | grep -v grep | grep -i \"vlmcsd\" | awk '{print $2}'`<br \/>\nif [ ! -z $PID ]; then<br \/>\nSTAT=0<br \/>\nelse<br \/>\nSTAT=1<br \/>\nfi<br \/>\n}<\/p>\n<p>do_restart() {<br \/>\ncheck_running<br \/>\nif [ $STAT = 0 ]; then<br \/>\necho \"Restarting KMS Server...\"<br \/>\nkill $PID<br \/>\nelif [ $STAT = 1 ]; then<br \/>\necho \"Not started, starting now\"<br \/>\nfi<br \/>\n$DAEMON -L 0.0.0.0:1688 -l vlmcsd.log<br \/>\ncheck_running<br \/>\nif [ $STAT = 0 ]; then<br \/>\necho \"Succeeded.\"<br \/>\nelif [ $STAT = 1 ]; then<br \/>\necho \"Failed.\"<br \/>\nfi<br \/>\n}<br \/>\ndo_stop() {<br \/>\ncheck_running<br \/>\nif [ $STAT = 0 ]; then<br \/>\necho \"Shutting down KMS Server...\"<br \/>\nkill $PID<br \/>\ncheck_running<br \/>\nif [ $STAT = 0 ]; then<br \/>\necho \"Failed.\"<br \/>\nelif [ $STAT = 1 ]; then<br \/>\necho \"Succeeded.\"<br \/>\nfi<br \/>\nelif [ $STAT = 1 ]; then<br \/>\necho \"Not running, no kill.\"<br \/>\nfi<br \/>\n}<br \/>\ndo_status() {<br \/>\ncheck_running<br \/>\nif [ $STAT = 0 ]; then<br \/>\necho \"KMS Server is running.\"<br \/>\nelif [ $STAT = 1 ]; then<br \/>\necho \"KMS Server is not running.\"<br \/>\nfi<br \/>\n}<\/p>\n<p>do_start() {<br \/>\ncheck_running<br \/>\nif [ $STAT = 0 ]; then<br \/>\necho \"KMS Server is already running.\"<br \/>\nexit 0;<br \/>\nelif [ $STAT = 1 ]; then<br \/>\necho \"KMS Server is not running, starting now...\"<br \/>\n$DAEMON -L 0.0.0.0:1688 -l vlmcsd.log<br \/>\nfi<br \/>\ncheck_running<br \/>\nif [ $STAT = 0 ]; then<br \/>\necho \"Succeeded.\"<br \/>\nelif [ $STAT = 1 ]; then<br \/>\necho \"Failed.\"<br \/>\nfi<br \/>\n}<\/p>\n<p>case \"$1\" in<br \/>\nstart|stop|restart|status)<br \/>\ndo_$1<br \/>\n;;<br \/>\n*)<br \/>\necho \"Usage: $0 start | stop | restart | status \"<br \/>\n;;<br \/>\nesac<\/p>\n<p><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6e90\u81eagit hub\uff1adakkidaze\/one-key-kms https:\/\/github.com\/Wind [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"_links":{"self":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts\/1598"}],"collection":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1598"}],"version-history":[{"count":11,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts\/1598\/revisions"}],"predecessor-version":[{"id":1601,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts\/1598\/revisions\/1601"}],"wp:attachment":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1598"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1598"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1598"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}