KSM скрипт с авто определением ОС и дальнейшей установкой
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
https://github.com/Wind4/vlmcsd/releases ______________________________________________________________________________________________________________ #!/bin/sh # VLMCSD - CentOS/Debian/RedHat/Ubuntu installer # 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 ls # 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 ______________________________________________________________________________________________________________ |
KSM debian:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
#!/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` GIT_TAGS=svn1112 cd ${TMP_DIR} https://github.com/Wind4/vlmcsd/releases/download/svn1112/binaries.tar.gz echo 'Downloading vlmcsd binaries ...' wget -q https://github.com/Wind4/vlmcsd/releases/download/${GIT_TAGS}/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.' |
KMS Centos
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
#!/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 '/bin/tar' ]; then echo 'Installing tar ...' yum -q -y install tar check_result $? "Can't install tar." echo 'Install tar succeed.' 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` GIT_TAG=svn1112 cd ${TMP_DIR} echo 'Downloading vlmcsd ...' wget -q https://github.com/Wind4/vlmcsd/releases/download/${GIT_TAG}/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.' |
KMS install debian \ ubuntu \ centos \ and over
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
0. mkdir 123 - создали каталог 123 1. cd 123 2. nano 1.sh - создаем файл 1.sh --------------------------------------- #!/bin/sh # VLMCSD - CentOS/Debian/RedHat/Ubuntu installer # 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 --------------------------------------- 3. sudo bash 1.sh - запускаем и получаем файл vlmcsd-Ваша_версия_Linux.sh и бинарник vlmcsd 4. sudo bash vlmcsd-Ваша_версия_Linux.sh - устанавливаем vlmcsd /usr/bin/vlmcsd - сюда будет установлен бинарник /etc/init.d/vlmcsd status /etc/init.d/vlmcsd start 5.!!! не скачался бинарник ошибка при запуске (для arm актуально) !!! bash: /usr/bin/vlmcsd: cannot execute binary file: Exec format error wget https://github.com/Wind4/vlmcsd/releases/download/svn1113/binaries.tar.gz - скачиваем вручную tar xf binaries.tar.gz - распаковываем cat /proc/cpuinfo - посмотреть процессор find * -name *armv7* - ищем нужный бинарник armv7 для ARMv7 !!! можете далее для удобства ковыряние по каталогам ставим mc (для Debian подобных apt-get install mc) !!! у меня нашлось кучу бинарников. у меня linux на orengpi процессор !!! для теста выбрал первый Linux/arm/little-endian/glibc/vlmcs-armv7el-glibc не запустился !!! попробовал /binaries/Linux/arm/little-endian/glibc/vlmcsdmulti-armv6hf-Raspberry-glibc запустился !!! Бинарник нужно будет положить вот сюда /usr/bin/ с именем vlmcsd !!! sudo cp Linux/arm/little-endian/glibc/vlmcsdmulti-armv6hf-Raspberry-glibc /usr/bin/vlmcsd скопировал его правильное место !!! все заработало |
orangepi
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
cat /proc/cpuinfo ----------------- model name : ARMv7 Processor rev 5 (v7l) BogoMIPS : 48.00 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xc07 CPU revision : 5 ----------------- cat /etc/os-release ------------------- PRETTY_NAME="Debian GNU/Linux 9 (stretch)" NAME="Debian GNU/Linux" VERSION_ID="9" VERSION="9 (stretch)" VERSION_CODENAME=stretch ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" ------------------- |