From 2c61e12d978204f288a187fb194fed757cfa6ac2 Mon Sep 17 00:00:00 2001 From: Wind4 Date: Mon, 24 Oct 2016 22:39:04 +0800 Subject: [PATCH] Remove binaries from gh-pages branch --- README.md | 25 +++++++++-- scripts/init.d/vlmcsd-debian | 77 ++++++++++++++++++++++++++++++++++ scripts/init.d/vlmcsd-rhel | 81 ++++++++++++++++++++++++++++++++++++ scripts/install-debian.sh | 64 ++++++++++++++++++++++++++++ scripts/install-rhel.sh | 71 +++++++++++++++++++++++++++++++ scripts/install.sh | 51 +++++++++++++++++++++++ 6 files changed, 366 insertions(+), 3 deletions(-) create mode 100644 scripts/init.d/vlmcsd-debian create mode 100644 scripts/init.d/vlmcsd-rhel create mode 100644 scripts/install-debian.sh create mode 100644 scripts/install-rhel.sh create mode 100644 scripts/install.sh diff --git a/README.md b/README.md index 5343c0d..805cf73 100644 --- a/README.md +++ b/README.md @@ -6,15 +6,16 @@ Start a Command Prompt as an `Administrator`. ### Windows ``` -slmgr.vbs -ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX -slmgr.vbs -skms kms.srv.crsoo.com:1688 +slmgr.vbs -ipk W269N-WFGWX-YVC9B-4J6C9-T83GX +slmgr.vbs -skms kms.srv.crsoo.com slmgr.vbs -ato ``` ### Office ``` cd C:\Program Files\Microsoft Office\Office15 -cscript ospp.vbs /inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX +cscript ospp.vbs /inpkey:YC7DK-G2NP3-2QQC3-J6H88-GVGXT +cscript ospp.vbs /sethst:kms.srv.crsoo.com cscript ospp.vbs /act ``` @@ -96,6 +97,24 @@ cscript ospp.vbs /act | Windows Server 2008 R2 Datacenter | 74YFP-3QFB3-KQT8W-PMXWJ-7M648 | | Windows Server 2008 R2 for Itanium-based Systems | GT63C-RJFQ3-4GMB6-BRFB9-CB83V | +### Office 2016 +| Product | GVLK | +| ----------------------------- | ----------------------------- | +| Office Professional Plus 2016 | XQNVK-8JYDB-WJ9W3-YJ8YR-WFG99 | +| Office Standard 2016 | JNRGM-WHDWX-FJJG3-K47QV-DRTFM | +| Project Professional 2016 | YG9NW-3K39V-2T3HJ-93F3Q-G83KT | +| Project Standard 2016 | GNFHQ-F6YQM-KQDGJ-327XX-KQBVC | +| Visio Professional 2016 | PD3PC-RHNGV-FXJ29-8JK7D-RJRJK | +| Visio Standard 2016 | 7WHWN-4T7MP-G96JF-G33KR-W8GF4 | +| Access 2016 | GNH9Y-D2J4T-FJHGG-QRVH7-QPFDW | +| Excel 2016 | 9C2PK-NWTVB-JMPW8-BFT28-7FTBF | +| OneNote 2016 | DR92N-9HTF2-97XKM-XW2WJ-XW3J6 | +| Outlook 2016 | R69KK-NTPKF-7M3Q4-QYBHW-6MT9B | +| PowerPoint 2016 | J7MQP-HNJ4Y-WJ7YM-PFYGF-BY6C6 | +| Publisher 2016 | F47MM-N3XJP-TQXJ9-BP99D-8K837 | +| Skype for Business 2016 | 869NQ-FJ69K-466HW-QYCP2-DDBV6 | +| Word 2016 | WXY84-JN2Q9-RBCCQ-3Q3J3-3PFJ6 | + ### Office 2013 | Product | GVLK | | ----------------------------- | ----------------------------- | diff --git a/scripts/init.d/vlmcsd-debian b/scripts/init.d/vlmcsd-debian new file mode 100644 index 0000000..12cec60 --- /dev/null +++ b/scripts/init.d/vlmcsd-debian @@ -0,0 +1,77 @@ +#!/bin/sh +# +# VLMCSD - this script starts and stops the KMS Server daemon +# +### BEGIN INIT INFO +# Provides: vlmcsd +# Required-Start: $local_fs $network $named $time $syslog +# Required-Stop: $local_fs $network $named $time $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Description: KMS Emulator in C +### END INIT INFO + +NAME=vlmcsd +SCRIPT=/usr/bin/vlmcsd +RUNAS= + +PIDFILE=/var/run/$NAME.pid +LOGFILE=/var/log/$NAME.log + +start() { + if [ -f "$PIDFILE" ] && kill -0 $(cat "$PIDFILE"); then + echo 'Service already running.' + return 1 + fi + echo 'Starting service...' + local CMD="$SCRIPT -p $PIDFILE -l $LOGFILE" + su -c "$CMD" $RUNAS + echo 'Service started.' +} + +stop() { + if [ ! -f "$PIDFILE" ] || ! kill -0 $(cat "$PIDFILE"); then + echo 'Service not running.' + return 1 + fi + echo 'Stopping service...' + kill -15 $(cat "$PIDFILE") && rm -f "$PIDFILE" + echo 'Service stopped.' +} + +status() { + echo "Checking $NAME service..." + if [ -f "$PIDFILE" ]; then + local PID=$(cat "$PIDFILE") + kill -0 $PID + if [ $? -eq 0 ]; then + echo "Running, the PID is $PID." + else + echo 'The process appears to be dead but pidfile still exists.' + fi + else + echo 'Service not running.' + fi +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status + ;; + restart) + stop + start + ;; + *) + echo "Usage: $0 {start|stop|status|restart}" + exit 1 + ;; +esac + +exit 0 \ No newline at end of file diff --git a/scripts/init.d/vlmcsd-rhel b/scripts/init.d/vlmcsd-rhel new file mode 100644 index 0000000..648e6b2 --- /dev/null +++ b/scripts/init.d/vlmcsd-rhel @@ -0,0 +1,81 @@ +#!/bin/sh +# +# VLMCSD - this script starts and stops the KMS Server daemon +# +### BEGIN SERVICE INFO +# Run level information: +# chkconfig: 2345 99 99 +# description: KMS Emulator in C +# processname: vlmcsd +### END SERVICE INFO + +# Source function library +source /etc/init.d/functions + +# Check that networking is up. +[ ${NETWORKING} ="yes" ] || exit 0 + +NAME=vlmcsd +SCRIPT=/usr/bin/vlmcsd +RUNAS= + +PIDFILE=/var/run/$NAME.pid +LOGFILE=/var/log/$NAME.log + +start() { + if [ -f "$PIDFILE" ] && kill -0 $(cat "$PIDFILE"); then + echo 'Service already running.' + return 1 + fi + echo 'Starting service...' + local CMD="$SCRIPT -p $PIDFILE -l $LOGFILE" + su -c "$CMD" $RUNAS + echo 'Service started.' +} + +stop() { + if [ ! -f "$PIDFILE" ] || ! kill -0 $(cat "$PIDFILE"); then + echo 'Service not running.' + return 1 + fi + echo 'Stopping service...' + kill -15 $(cat "$PIDFILE") && rm -f "$PIDFILE" + echo 'Service stopped.' +} + +status() { + echo "Checking $NAME service..." + if [ -f "$PIDFILE" ]; then + local PID=$(cat "$PIDFILE") + kill -0 $PID + if [ $? -eq 0 ]; then + echo "Running, the PID is $PID." + else + echo 'The process appears to be dead but pidfile still exists.' + fi + else + echo 'Service not running.' + fi +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status + ;; + restart) + stop + start + ;; + *) + echo "Usage: $0 {start|stop|status|restart}" + exit 1 + ;; +esac + +exit 0 \ No newline at end of file diff --git a/scripts/install-debian.sh b/scripts/install-debian.sh new file mode 100644 index 0000000..d0c74f6 --- /dev/null +++ b/scripts/install-debian.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# +# Install a VLMCSD service for Debian/Ubuntu +# +# Author: Wind4 (puxiaping@gmail.com) +# Date: November 30, 2015 +# + +check_result() { + if [ $1 -ne 0 ]; then + echo "Error: $2" >&2 + exit $1 + fi +} + +if [ "x$(id -u)" != 'x0' ]; then + echo 'Error: This script can only be executed by root' + exit 1 +fi + +if [ -f '/etc/init.d/vlmcsd' ]; then + echo 'VLMCSD service has been installed.' + exit 1 +fi + +if [ ! -f '/usr/bin/wget' ]; then + echo 'Installing wget ...' + apt-get -qq update + apt-get -qq install -y wget + check_result $? "Can't install wget." + echo 'Install wget succeed.' +fi + +TMP_DIR=`mktemp -d` +cd ${TMP_DIR} + +echo 'Downloading vlmcsd binaries ...' +wget -q https://github.com/Wind4/vlmcsd/releases/download/svn1085/binaries.tar.gz -O binaries.tar.gz +check_result $? 'Download vlmcsd failed.' + +echo 'Downloading startup script ...' +wget -q https://wind4.github.io/vlmcsd/scripts/init.d/vlmcsd-debian -O vlmcsd.init +check_result $? 'Download startup script failed.' + +echo 'Extract vlmcsd ...' +tar zxf binaries.tar.gz +cp binaries/Linux/intel/static/vlmcsd-x86-musl-static /usr/bin/vlmcsd +cp vlmcsd.init /etc/init.d/vlmcsd + +echo 'Fix Permissions ...' +chmod 755 /usr/bin/vlmcsd +chown root.root /usr/bin/vlmcsd +chmod 755 /etc/init.d/vlmcsd +chown root.root /etc/init.d/vlmcsd + +echo 'Configuring deamon ...' +update-rc.d vlmcsd defaults +service vlmcsd start +check_result $? 'Installation failed.' + +echo 'Cleaning ...' +rm -rf ${TMP_DIR} + +echo 'Installed successfully.' \ No newline at end of file diff --git a/scripts/install-rhel.sh b/scripts/install-rhel.sh new file mode 100644 index 0000000..096f616 --- /dev/null +++ b/scripts/install-rhel.sh @@ -0,0 +1,71 @@ +#!/bin/bash +# +# Install a VLMCSD service for CentOS/RedHat +# +# Author: Wind4 (puxiaping@gmail.com) +# Date: November 30, 2015 +# + +check_result() { + if [ $1 -ne 0 ]; then + echo "Error: $2" >&2 + exit $1 + fi +} + +if [ "x$(id -u)" != 'x0' ]; then + echo 'Error: This script can only be executed by root' + exit 1 +fi + +if [ -f '/etc/init.d/vlmcsd' ]; then + echo 'VLMCSD service has been installed.' + exit 1 +fi + +if [ ! -f '/usr/bin/wget' ]; then + echo 'Installing wget ...' + yum -q -y install wget + check_result $? "Can't install wget." + echo 'Install wget succeed.' +fi + +if [ ! -f '/sbin/service' ]; then + echo 'Installing initscripts ...' + yum -q -y install initscripts + check_result $? "Can't install initscripts." + echo 'Install initscripts succeed.' +fi + +TMP_DIR=`mktemp -d` +cd ${TMP_DIR} + +echo 'Downloading vlmcsd ...' +wget -q https://github.com/Wind4/vlmcsd/releases/download/svn1085/binaries.tar.gz -O binaries.tar.gz +check_result $? 'Download vlmcsd failed.' + +echo 'Downloading startup script ...' +wget -q https://wind4.github.io/vlmcsd/scripts/init.d/vlmcsd-rhel -O vlmcsd.init +check_result $? 'Download startup script failed.' + +echo 'Extract vlmcsd ...' +tar zxf binaries.tar.gz +cp binaries/Linux/intel/static/vlmcsd-x86-musl-static /usr/bin/vlmcsd +cp vlmcsd.init /etc/init.d/vlmcsd + +echo 'Fix Permissions ...' +chmod 755 /usr/bin/vlmcsd +chown root.root /usr/bin/vlmcsd +chmod 755 /etc/init.d/vlmcsd +chown root.root /etc/init.d/vlmcsd + +echo 'Configuring deamon ...' +chkconfig --add vlmcsd +chkconfig vlmcsd on +service vlmcsd start +check_result $? 'Installation failed.' + +echo 'Cleaning ...' +rm -rf ${TMP_DIR} + +echo 'Installed successfully.' \ No newline at end of file diff --git a/scripts/install.sh b/scripts/install.sh new file mode 100644 index 0000000..3adca4d --- /dev/null +++ b/scripts/install.sh @@ -0,0 +1,51 @@ +#!/bin/sh +# +# VLMCSD - CentOS/Debian/RedHat/Ubuntu installer +# +# Author: Wind4 (puxiaping@gmail.com) +# Date: November 30, 2015 +# + +# Detect OS +if [ -f /etc/debian_version ]; then + ostype='debian' +elif [ -f /etc/lsb-release ]; then + ostype='ubuntu' +elif [ -f /etc/redhat-release ]; then + ostype='rhel' +else + echo 'This script only support CentOS/Debian/RedHat/Ubuntu.' >&2 + exit 1 +fi + +# Checking wget +if [ ! -f /usr/bin/wget ]; then + case $ostype in + debian|ubuntu) + apt-get update -yqq + apt-get install -yqq wget + ;; + rhel) + yum install -y -q wget + ;; + esac + if [ "$?" -ne '0' ]; then + echo "Error: Can't install wget" >&2 + exit 1 + fi +fi + +# Select script type +case $ostype in + debian|ubuntu) type='debian' ;; + rhel) type='rhel' ;; +esac + +wget https://wind4.github.io/vlmcsd/scripts/install-$type.sh -O vlmcsd-$type.sh +if [ "$?" -eq '0' ]; then + bash vlmcsd-$type.sh $* + exit +else + echo 'Download installer failed.' >&2 + exit 1 +fi \ No newline at end of file