Commit a3a5c3bc authored by Jondy Zhao's avatar Jondy Zhao

slapos-cygwin-bootstrip:

  add function show_usage
  add function check_os_is_wow64
parent a9a9a49c
#! /bin/bash #! /bin/bash
# #
# This script is used to build a bootstrip slapos in the cywin. function check_os_is_wow64()
# {
# Usage: [[ $(uname) == CYGWIN_NT-*-WOW64 ]]
# }
# ./slapos-cygwin-bootstrip.sh readonly -f check_os_is_wow64
#
# Before run this script, type the following command in the windows function show_usage()
# command console to install cygwin: {
# echo "This script is used to build a bootstrip slapos in the cywin."
# setup_cygwin.bat C:\slapos-bootstrip network echo ""
# echo "Usage:"
# Then sign up slapos.org, got the following certificate files: echo ""
# echo " ./slapos-cygwin-bootstrip.sh"
# certificate echo ""
# key echo "Before run this script, type the following command in the windows"
# echo "command console to install cygwin:"
# computer.key echo ""
# computer.crt echo " setup_cygwin.bat C:\slapos-bootstrip network"
# echo ""
# save them in your home path. echo "Then sign up slapos.org, got the following certificate files:"
# echo ""
echo " certificate"
echo " key"
echo " computer.key"
echo " computer.crt"
echo ""
echo "save them in your home path."
echo ""
}
readonly -f show_usage
export PATH=/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin:$PATH export PATH=/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin:$PATH
if ! source /usr/share/csih/cygwin-service-installation-helper.sh ; then if ! source /usr/share/csih/cygwin-service-installation-helper.sh ; then
echo "Error: Missing csih package." echo "Error: Missing csih package."
...@@ -97,7 +107,7 @@ for _cmdname in ip useradd usermod groupadd brctl tunctl ; do ...@@ -97,7 +107,7 @@ for _cmdname in ip useradd usermod groupadd brctl tunctl ; do
done done
if [[ ! -x /usr/bin/ipwin.exe ]] ; then if [[ ! -x /usr/bin/ipwin.exe ]] ; then
if [[ $(uname) == CYGWIN_NT-*-WOW64 ]] ; then if check_os_is_wow64 ; then
wget http://dashingsoft.com/products/slapos/ipwin_x64.exe -O /usr/bin/ipwin.exe || wget http://dashingsoft.com/products/slapos/ipwin_x64.exe -O /usr/bin/ipwin.exe ||
csih_error "download ipwin_x64.exe failed" csih_error "download ipwin_x64.exe failed"
csih_inform "download ipwin_x64.exe OK" csih_inform "download ipwin_x64.exe OK"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment