slapos-cygwin-bootstrap.sh 18.9 KB
Newer Older
1 2
#! /bin/bash
#
Jondy Zhao's avatar
Jondy Zhao committed
3 4 5 6 7 8 9 10
function check_os_is_wow64()
{
  [[ $(uname) == CYGWIN_NT-*-WOW64 ]]
}
readonly -f check_os_is_wow64

function show_usage()
{
11
    echo "This script is used to build a bootstrap slapos in cywin."
Jondy Zhao's avatar
Jondy Zhao committed
12 13 14
    echo ""
    echo "Usage:"
    echo ""
15
    echo "  ./slapos-cygwin-bootstrap.sh"
Jondy Zhao's avatar
Jondy Zhao committed
16 17 18 19
    echo ""
    echo "Before run this script, type the following command in the windows"
    echo "command console to install cygwin:"
    echo ""
20
    echo "  setup_cygwin.bat C:\slapos-bootstrap network"
Jondy Zhao's avatar
Jondy Zhao committed
21 22 23 24 25 26 27 28 29 30 31 32 33
    echo ""
    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

34 35 36 37 38 39
export PATH=/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin:$PATH
if ! source /usr/share/csih/cygwin-service-installation-helper.sh ; then
    echo "Error: Missing csih package."
    exit 1
fi

40
csih_inform "Starting bootstrap slapos node ..."
41 42 43 44 45
echo ""

# ======================================================================
# Constants
# ======================================================================
46
declare -r slapos_prefix=slapboot-
47 48 49 50 51 52 53 54 55 56 57
declare -r slapos_client_home=~/.slapos
declare -r client_configure_file=$slapos_client_home/slapos.cfg
declare -r client_certificate_file=$slapos_client_home/certificate
declare -r client_key_file=$slapos_client_home/key

declare -r node_certificate_file=/etc/opt/slapos/ssl/computer.crt
declare -r node_key_file=/etc/opt/slapos/ssl/computer.key
declare -r node_configure_file=/etc/opt/slapos/slapos.cfg

declare -r ipv4_local_network=10.202.29.0/24
declare -r ipv6_local_address=2001:67c:1254:e:32::1
58 59 60 61 62 63 64 65

declare -r slapos_administrator=${slapos_prefix:-slap}root
declare -r slapos_user_basename=${slapos_prefix:-slap}user
declare -r slapos_ifname=${slapos_prefix}re6stnet-lo
declare -r re6stnet_service_name=${slapos_prefix}re6stnet
declare -r cron_service_name=${slapos_prefix}cron
declare -r syslog_service_name=${slapos_prefix}syslog-ng
declare -r cygserver_service_name=${slapos_prefix}cygserver
66 67

declare -r slapos_installer_software=http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/cygwin-share:/software/slapos-windows-installer/software.cfg
68
declare -r cygwin_home=$(cygpath -a $(cygpath -w /)\\.. | sed -e "s%/$%%")
69

70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
# -----------------------------------------------------------
# Local variable
# -----------------------------------------------------------
declare _administrator=${slapos_administrator}
declare _password=
declare _computer_certificate=
declare _computer_key=
declare _client_certificate=
declare _client_key=
declare _ipv4_local_network=${ipv4_local_network}

# -----------------------------------------------------------
# Command line options
# -----------------------------------------------------------
while test $# -gt 0; do
    # Normalize the prefix.
    case "$1" in
    -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
    *) optarg= ;;
    esac

    case "$1" in
    --password=*)
    _password=$optarg
    ;;
    -P)
    _password=$2
    shift
    ;;
    -P)
    _administrator=$2
    shift
    ;;
    --computer-certificate=*)
    _computer_certificate=$optarg
    ;;
    --computer-key=*)
    _computer_key=$optarg
    ;;
    --client-certificate=*)
    _client_certificate=$optarg
    ;;
    --client-key=*)
    _client_key=$optarg
    ;;
    --ipv4-local-network=*)
    [[ x$optarg == x*.*.*.*/* ]] ||
    csih_error "invalid --ipv4-local-network=$optarg, no match x.x.x.x/x"
    _ipv4_local_network=$optarg
    ;;
    *)
    show_usage
    exit 1
    ;;
    esac

    # Next please.
    shift
done

130 131 132 133 134
# -----------------------------------------------------------
# Patch cygwin packages for building slapos
# -----------------------------------------------------------
csih_inform "Patching cygwin packages for building slapos"

135 136 137
csih_check_program_or_error /usr/bin/cygport cygport
csih_check_program_or_error /usr/bin/libtool libtool

138 139 140 141 142 143 144 145 146
csih_inform "libtool patched"
sed -i -e "s/4\.3\.4/4.5.3/g" /usr/bin/libtool

csih_inform "/etc/passwd generated"
[[ -f /etc/passwd ]] || mkpasswd > /etc/passwd

csih_inform "/etc/group generated"
[[ -f /etc/group ]] || mkgroup > /etc/group

147 148 149
_filename=$(cygpath -a -w $(cygpath -w /)\\..\\setup.exe)
csih_inform "check ${_filename}"
[[ -f $(cygpath -u ${_filename}) ]] || csih_error "missing ${_filename}"
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176

_filename=/usr/bin/cygport
if [[ -f ${_filename} ]] ; then
    csih_inform "Patching ${_filename} ..."
    sed -i -e 's/D="${workdir}\/inst"/D="${CYGCONF_PREFIX-${workdir}\/inst}"/g' ${_filename} &&
    csih_inform "OK"
else
    csih_error "Missing cygport package, no ${_filename} found."
fi
_filename=/usr/share/cygport/cygclass/autotools.cygclass
if [[ -f ${_filename} ]] ; then
    csih_inform "Patching ${_filename} ..."
    sed -i -e 's/prefix=$(__host_prefix)/prefix=${CYGCONF_PREFIX-$(__host_prefix)}/g' ${_filename} &&
    csih_inform "OK"
else
    csih_error "Missing cygport package, no ${_filename} found."
fi
_filename=/usr/share/cygport/cygclass/cmake.cygclass
if [[ -f ${_filename} ]] ; then
    csih_inform "Patching ${_filename} ..."
    sed -i -e 's/-DCMAKE_INSTALL_PREFIX=$(__host_prefix)/-DCMAKE_INSTALL_PREFIX=${CYGCONF_PREFIX-$(__host_prefix)}/g' ${_filename} &&
    csih_inform "OK"
else
    csih_error "Missing cygport package, no ${_filename} found."
fi

for _cmdname in ip useradd usermod groupadd brctl tunctl ; do
Jondy Zhao's avatar
Jondy Zhao committed
177
    wget -c http://git.erp5.org/gitweb/slapos.package.git/blob_plain/heads/cygwin:/windows/scripts/${_cmdname} -O /usr/bin/${_cmdname} ||
178 179
    csih_error "download ${_cmdname} failed"
    csih_inform "download cygwin script ${_cmdname} OK"
Jondy Zhao's avatar
Jondy Zhao committed
180
    chmod +x /usr/bin/${_cmdname} || csih_error "chmod /usr/bin/${_cmdname} failed"
181 182
done

Jondy Zhao's avatar
Jondy Zhao committed
183
if check_os_is_wow64 ; then
184 185 186
    wget -c http://dashingsoft.com/products/slapos/ipwin-x64.exe -O /usr/bin/ipwin.exe ||
    csih_error "download ipwin-x64.exe failed"
    csih_inform "download ipwin-x64.exe OK"
Jondy Zhao's avatar
Jondy Zhao committed
187
else
188 189 190
    wget -c http://dashingsoft.com/products/slapos/ipwin-x86.exe -O /usr/bin/ipwin.exe ||
    csih_error "download ipwin-x86.exe failed"
    csih_inform "download ipwin-x86.exe OK"
191
fi
Jondy Zhao's avatar
Jondy Zhao committed
192
chmod +x /usr/bin/ipwin.exe || csih_error "chmod /usr/bin/ipwin.exe failed"
193 194 195 196 197 198 199 200 201 202

csih_inform "Patch cygwin packages for building slapos OK"
echo ""

# -----------------------------------------------------------
# Install network interface used by slapos node
# -----------------------------------------------------------
csih_inform "Starting configure slapos network ..."
if ! netsh interface ipv6 show interface | grep -q "\\b${slapos_ifname}\\b" ; then
    csih_inform "Installing network interface ${slapos_ifname} ..."
203
    ipwin install netloop.inf *msloop ${slapos_ifname} ||
204 205
    csih_error "install network interface ${slapos_ifname} failed"
fi
206
ip -4 addr add $(echo ${ipv4_local_network} | sed -e "s%\.0/%.1/%g") dev ${slapos_ifname} ||
207 208 209 210 211 212 213 214 215 216 217 218
csih_error "add ipv4 address failed"

csih_inform "Configure slapos network OK"
echo ""

# -----------------------------------------------------------
# Check IPv6 protocol, install it if it isn't installed
# -----------------------------------------------------------
csih_inform "Starting configure IPv6 protocol ..."
netsh interface ipv6 show interface > /dev/null || \
    netsh interface ipv6 install || \
    csih_error "install IPv6 protocol failed"
219

220 221 222 223 224 225 226 227 228 229 230 231 232 233
csih_inform "Configure IPv6 protocol OK"
echo ""

# -----------------------------------------------------------
# Run the buildout of slapos node
# -----------------------------------------------------------
csih_inform "Starting run buildout of slapos node ..."

csih_inform "mkdir /opt/slapos/log"
mkdir -p /opt/slapos/log

csih_inform "mkdir /opt/download-cache"
mkdir -p /opt/download-cache

Jondy Zhao's avatar
Jondy Zhao committed
234
[[ -f /opt/slapos/buildout.cfg ]] ||
235 236 237 238
(cd /opt/slapos && echo "[buildout]
extends = http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/cygwin-share:/component/slapos/buildout.cfg
download-cache = /opt/download-cache
prefix = ${buildout:directory}
Jondy Zhao's avatar
Jondy Zhao committed
239 240
" > buildout.cfg) &&
csih_inform "buildout.cfg generated"
241

Jondy Zhao's avatar
Jondy Zhao committed
242
[[ -f /opt/slapos/bootstrap.py ]] ||
Jondy Zhao's avatar
Jondy Zhao committed
243 244
(cd /opt/slapos &&
python -S -c 'import urllib2;print urllib2.urlopen("http://git.erp5.org/gitweb/slapos.core.git/blob_plain/HEAD:/bootstrap.py").read()' > bootstrap.py ) ||
245
csih_error "download bootstrap.py failed"
Jondy Zhao's avatar
Jondy Zhao committed
246
csih_inform "download bootstrap.py OK"
247

Jondy Zhao's avatar
Jondy Zhao committed
248
[[ -f /opt/slapos/bin/buildout ]] ||
Jondy Zhao's avatar
Jondy Zhao committed
249
(cd /opt/slapos && python -S bootstrap.py) ||
Jondy Zhao's avatar
Jondy Zhao committed
250 251
csih_error "run bootstrap.py failed"
csih_inform  "run bootstrap.py OK"
252 253

csih_inform "start bin/buildout"
Jondy Zhao's avatar
Jondy Zhao committed
254
(cd /opt/slapos ; bin/buildout -v -N) || csih_error "bin/buildout failed"
255 256

_filename=~/slapos-core-format.patch
257
wget -c http://git.erp5.org/gitweb/slapos.package.git/blob_plain/heads/cygwin:/windows/patches/$(basename ${_filename}) -O ${_filename} ||
258 259 260
csih_error "download ${_filename} failed"
csih_inform "download ${_filename} OK"

Jondy Zhao's avatar
Jondy Zhao committed
261 262
csih_inform "applay patch ${_filename}"
(cd $(ls -d /opt/slapos/eggs/slapos.core-*.egg/) &&
263 264 265
csih_inform "patch at $(pwd)" &&
patch -f --dry-run -p1 < ${_filename} > /dev/null &&
patch -p1 < ${_filename} &&
Jondy Zhao's avatar
Jondy Zhao committed
266
csih_inform "apply patch ${_filename} OK")
267

268 269 270 271 272 273 274 275 276 277 278 279
_filename=~/supervisor-cygwin.patch
wget -c http://git.erp5.org/gitweb/slapos.package.git/blob_plain/heads/cygwin:/windows/patches/$(basename ${_filename}) -O ${_filename} ||
csih_error "download ${_filename} failed"
csih_inform "download ${_filename} OK"

csih_inform "applay patch ${_filename}"
(cd $(ls -d /opt/slapos/eggs/supervisor-*.egg)/supervisor &&
csih_inform "patch at $(pwd)" &&
patch -f --dry-run -p1 < ${_filename} > /dev/null &&
patch -p1 < ${_filename} &&
csih_inform "apply patch ${_filename} OK")

280 281 282 283 284 285 286 287 288 289 290
csih_inform "Run buildout of slapos node OK"
echo ""

# -----------------------------------------------------------
# Configure slapos node and client
# -----------------------------------------------------------
csih_inform "Starting configure slapos client and node ..."

for _name in certificate key computer.key computer.crt ; do
    [[ -f ~/${_name} ]] || csih_error "missing file ~/${_name}"
done
291 292
for _name in test-computer.key test-computer.crt ; do
    [[ -f ${cygwin_home}/${_name} ]] || csih_error "missing file ${cygwin_home}/${_name}"
293
done
294 295
cp ~/certificate ${cygwin_home} && csih_inform "copy ~/certificate to ${cygwin_home}"
cp ~/key ${cygwin_home} && csih_inform "copy ~/key to ${cygwin_home}"
296 297 298 299 300 301

csih_inform "mkdir /etc/opt/slapos/ssl/partition_pki"
mkdir -p /etc/opt/slapos/ssl/partition_pki
csih_inform "mkdir ${slapos_client_home}"
mkdir -p ${slapos_client_home}

Jondy Zhao's avatar
Jondy Zhao committed
302 303 304 305 306 307 308
(cp ~/certificate ${client_certificate_file} &&
cp ~/key ${client_key_file} &&
cp ~/computer.crt ${node_certificate_file} &&
cp ~/computer.key ${node_key_file} &&
csih_inform "copy certificate/key files OK") ||
csih_error "copy certificate/key files failed"

309 310 311 312 313 314 315 316 317 318 319 320 321 322
computer_guid=$(grep "CN=COMP" ${node_certificate_file} | \
    sed -e "s/^.*, CN=//g" | sed -e "s%/emailAddress.*\$%%g")
[[ "${computer_guid}" == COMP-+([0-9]) ]] ||
csih_error_multi "${computer_guid} is invalid computer guid." \
    "It should like 'COMP-XXXX', edit ${node_certificate_file}" \
    "to fix it."
csih_inform "computer reference id: ${computer_guid}"

interface_guid=$(ipwin guid *msloop ${slapos_ifname}) ||
csih_error "get guid of interface ${slapos_ifname} failed"
[[ "$interface_guid" == {*-*-*-*} ]] ||
csih_error "invalid interface guid ${interface_guid} specified."
csih_inform "the guid of interface ${slapos_ifname} is ${interface_guid}"

Jondy Zhao's avatar
Jondy Zhao committed
323
wget -c http://git.erp5.org/gitweb/slapos.core.git/blob_plain/HEAD:/slapos.cfg.example -O ${node_configure_file} ||
324 325
csih_error "download ${node_configure_file} failed"
csih_inform "download ${node_configure_file} OK"
Jondy Zhao's avatar
Jondy Zhao committed
326
wget -c http://git.erp5.org/gitweb/slapos.core.git/blob_plain/HEAD:/slapos-client.cfg.example -O ${client_configure_file} ||
327 328 329 330 331 332 333 334
csih_error "download ${node_configure_file} failed"
csih_inform "download ${node_configure_file} OK"

csih_inform "ipv4_local_network is ${ipv4_local_network}"
sed -i  -e "s%^\\s*interface_name.*$%interface_name = ${interface_guid}%" \
        -e "s%^#\?\\s*ipv6_interface.*$%# ipv6_interface =%g" \
        -e "s%^ipv4_local_network.*$%ipv4_local_network = ${ipv4_local_network}%" \
        -e "s%^computer_id.*$%computer_id = ${computer_guid}%" \
335
        -e "s%^user_base_name =.*$%user_base_name = ${slapos_user_basename}%" \
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351
        ${node_configure_file}
csih_inform "type ${node_configure_file}:"
csih_inform "************************************************************"
cat ${node_configure_file}
csih_inform "************************************************************"

sed -i -e "s%^cert_file.*$%cert_file = ${client_certificate_file}%" \
       -e "s%^key_file.*$%key_file = ${client_key_file}%" \
       ${client_configure_file}
csih_inform "type ${client_configure_file}:"
csih_inform "************************************************************"
cat ${client_configure_file}
csih_inform "************************************************************"

csih_inform "Configure slapos client and node OK"
echo ""
352

353 354 355
# -----------------------------------------------------------
# Format slapos node
# -----------------------------------------------------------
Marco Mariani's avatar
Marco Mariani committed
356
csih_inform "Formatting SlapOS Node ..."
357

Jondy Zhao's avatar
Jondy Zhao committed
358
netsh interface ipv6 add addr ${slapos_ifname} ${ipv6_local_address}
359 360 361 362 363 364
/opt/slapos/bin/slapos node format -cv --now ||
csih_error "Run slapos node format failed. "

echo ""

# -----------------------------------------------------------
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397
# Check and configure cygwin environments
# -----------------------------------------------------------
csih_check_program_or_error /usr/bin/cygrunsrv cygserver
csih_check_program_or_error /usr/bin/syslog-ng-config syslog-ng
csih_check_program_or_error /usr/bin/openssl openssl
csih_check_program_or_error /usr/bin/ipwin slapos-patches
csih_check_program_or_error /usr/bin/slapos-cron-config slapos-patches

if [[ ! ":$PATH" == :/opt/slapos/bin: ]] ; then
    for profile in ~/.bash_profile ~/.profile ; do
        ! grep -q "export PATH=/opt/slapos/bin:" $profile &&
        csih_inform "add /opt/slapos/bin to PATH" &&
        echo "export PATH=/opt/slapos/bin:\${PATH}" >> $profile
    done
fi

_path=/etc/slapos/scripts
csih_inform "create path: ${_path}"
mkdir -p ${_path}
for _name in slapos-configure.sh slapos-include.sh post-install.sh slapos-cleanup.sh ; do
    wget -c http://git.erp5.org/gitweb/slapos.package.git/blob_plain/heads/cygwin:/windows/scripts/${_name} -O ${_path}/${_name} ||
    csih_error "download ${_name} failed"
    csih_inform "download script ${_path}/${_name} OK"
done

# Set prefix for slapos
if [[ -n ${slapos_prefix} ]] ; then
    echo "Set slapos prefix as ${slapos_prefix}"
    sed -i -e "s%slapos_prefix=.*\$%slapos_prefix=${slapos_prefix}%" ${_path|/slapos-include.sh
fi

# -----------------------------------------------------------
# Create account: slaproot
398
# -----------------------------------------------------------
399 400 401 402 403 404 405
# Start seclogon service in the Windows XP
if csih_is_xp ; then
    csih_inform "set start property of seclogon to auto"
    sc config seclogon start= auto ||
    csih_warning "failed to set seclogon to auto start."
# In the later, it's RunAs service, and will start by default
fi
406

407 408 409
# echo Checking slapos account ${_administrator} ...
slapos_check_and_create_privileged_user ${_administrator} ${_password} ||
csih_error "failed to create account ${_administrator}."
410

411 412 413 414 415 416 417 418 419 420 421 422 423 424 425
# -----------------------------------------------------------
# Configure cygwin services: cygserver syslog-ng
# -----------------------------------------------------------
csih_inform "Starting configure cygwin services ..."
if ! cygrunsrv --query ${cygserver_service_name} > /dev/null 2>&1 ; then
    csih_inform "run cygserver-config ..."
    /usr/bin/cygserver-config --yes || \
        csih_error "failed to run cygserver-config"
    [[ ${cygserver_service_name} == cygserver ]] ||
    cygrunsrv -I ${cygserver_service_name} -d "CYGWIN ${cygserver_service_name}" -p /usr/sbin/cygserver ||
    csih_error "failed to install service ${cygserver_service_name}"
else
    csih_inform "the cygserver service has been installed"
fi
check_cygwin_service ${cygserver_service_name}
426

427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457
if ! cygrunsrv --query ${syslog_service_name} > /dev/null 2>&1 ; then
    csih_inform "run syslog-ng-config ..."
    /usr/bin/syslog-ng-config --yes || \
        csih_error "failed to run syslog-ng-config"
    [[ ${syslog_service_name} == "syslog-ng" ]] ||
    cygrunsrv -I ${syslog_service_name} -d "CYGWIN ${syslog_service_name}" -p /usr/sbin/syslog-ng -a "-F" ||
    csih_error "failed to install service ${syslog_service_name}"

else
    csih_inform "the syslog-ng service has been installed"
fi
check_cygwin_service ${syslog_service_name}

# Use slapos-cron-config to configure slapos cron service.
if ! cygrunsrv --query ${cron_service_name} > /dev/null 2>&1 ; then
    [[ -x ${slapos_cron_config} ]] ||
    csih_error "Couldn't find slapos cron config script: ${slapos_cron_config}"

    if [[ -z "${csih_PRIVILEGED_PASSWORD}" ]] ; then
        slapos_request_password ${_administrator} "Install cron service need the password of ${_administrator}."
    fi

    csih_inform "run slapos-cron-config ..."
    ${slapos_cron_config} ${cron_service_name} ${_administrator} ${csih_PRIVILEGED_PASSWORD} ||
    csih_error "Failed to run ${slapos_cron_config}"
else
    csih_inform "the cron service has been installed"
fi
check_cygwin_service ${cron_service_name}

csih_inform "Configure cygwin services OK"
458 459 460
echo ""

# -----------------------------------------------------------
461
# cron: Install cron service and create crontab
462
# -----------------------------------------------------------
463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483
csih_inform "Starting configure section cron ..."

_cron_user=${_administrator}
_crontab_file="/var/cron/tabs/${_cron_user}"
if [[ ! -f ${_crontab_file} ]] ; then
    cat <<EOF  > ${_crontab_file}
SHELL=/bin/bash
PATH=/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
MAILTO=""

# Run "Installation/Destruction of Software Releases" and "Deploy/Start/Stop Partitions" once per minute
* * * * * /opt/slapos/bin/slapos node software --verbose --logfile=/opt/slapos/log/slapos-node-software.log > /dev/null 2>&1
* * * * * /opt/slapos/bin/slapos node instance --verbose --logfile=/opt/slapos/log/slapos-node-instance.log > /dev/null 2>&1

# Run "Destroy Partitions to be destroyed" once per hour
0 * * * * /opt/slapos/bin/slapos node report --maximal_delay=3600 --verbose --logfile=/opt/slapos/log/slapos-node-report.log > /dev/null 2>&1

# Run "Check/add IPs and so on" once per hour
0 * * * * /opt/slapos/bin/slapos node format >> /opt/slapos/log/slapos-node-format.log 2>&1
EOF
fi
484

485 486
csih_inform "change owner of ${_crontab_file} to ${_cron_user}"
chown ${_cron_user} ${_crontab_file}
487

488 489 490
csih_inform "change mode of ${_crontab_file} to 644"
chmod 644 ${_crontab_file}
ls -l ${_crontab_file}
491

492 493 494 495 496 497 498 499
csih_inform "begin of crontab of ${_administrator}:"
csih_inform "************************************************************"
cat ${_crontab_file} || csih_error "No crob tab found."
csih_inform "************************************************************"
csih_inform "end of crontab of ${_administrator}"

csih_inform "Configure section cron OK"
echo ""
500 501

echo ""
502
csih_inform "Configure slapos bootstrap node successfully."
503 504 505 506
echo ""

read -n 1 -t 60 -p "Press any key to exit..."
exit 0