????

Your IP : 3.144.224.210


Current Path : /etc/rc.d/
Upload File :
Current File : //etc/rc.d/serial

#!/bin/sh
#
# Copyright (c) 1996  Andrey A. Chernov
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD: releng/12.1/libexec/rc/rc.d/serial 180619 2008-07-19 20:12:02Z marcel $
#

# PROVIDE: serial
# REQUIRE: root
# KEYWORD: nojail

# Change some defaults for serial devices.
# Standard defaults are:
#	dtrwait 300 drainwait `sysctl -n kern.drainwait`
#	initial cflag from <sys/ttydefaults.h> = cread cs8 hupcl
#	initial iflag, lflag and oflag all 0
#	speed 9600
#	special chars from <sys/ttydefaults.h>
#	nothing locked
# except for serial consoles the initial iflag, lflag and oflag are from
# <sys/ttydefaults.h> and clocal is locked on.

default() {
	# Reset everything changed by the other functions to initial defaults.

	dc=$1; shift	# device name character
	drainwait=`sysctl -n kern.drainwait`

	for i in $*
	do
		comcontrol /dev/tty${dc}${i} dtrwait 300 drainwait $drainwait
		stty < /dev/tty${dc}${i}.init -clocal crtscts hupcl 9600 reprint ^R
		stty < /dev/tty${dc}${i}.lock -clocal -crtscts -hupcl 0
		stty < /dev/cua${dc}${i}.init -clocal crtscts hupcl 9600 reprint ^R
		stty < /dev/cua${dc}${i}.lock -clocal -crtscts -hupcl 0
	done
}

maybe() {
	# Special settings.

	dc=$1; shift

	for i in $*
	do
		# Don't use ^R; it breaks bash's ^R when typed ahead.
		stty < /dev/tty${dc}${i}.init reprint undef
		stty < /dev/cua${dc}${i}.init reprint undef
		# Lock clocal off on dialin device for security.
		stty < /dev/tty${dc}${i}.lock clocal
		# Lock the speeds to use old binaries that don't support them.
		# Any legal speed works to lock the initial speed.
		stty < /dev/tty${dc}${i}.lock 300
		stty < /dev/cua${dc}${i}.lock 300
	done
}

modem() {
	# Modem that supports CTS and perhaps RTS handshaking.

	dc=$1; shift

	for i in $*
	do
		# may depend on modem
		comcontrol /dev/tty${dc}${i} dtrwait 100 drainwait 180
		# Lock crtscts on.
		# Speed reasonable for V42bis.
		stty < /dev/tty${dc}${i}.init crtscts 115200
		stty < /dev/tty${dc}${i}.lock crtscts
		stty < /dev/cua${dc}${i}.init crtscts 115200
		stty < /dev/cua${dc}${i}.lock crtscts
	done
}

mouse() {
	# Mouse on either callin or callout port.

	dc=$1; shift

	for i in $*
	do
		# Lock clocal on, hupcl off.
		# Standard speed for Microsoft mouse.
		stty < /dev/tty${dc}${i}.init clocal -hupcl 1200
		stty < /dev/tty${dc}${i}.lock clocal  hupcl
		stty < /dev/cua${dc}${i}.init clocal -hupcl 1200
		stty < /dev/cua${dc}${i}.lock clocal  hupcl
	done
}

terminal() {
	# Terminal that supports CTS and perhaps RTS handshaking
	# with the cable or terminal arranged so that DCD is on
	# at least while the terminal is on.
	# Also works for bidirectional communications to another pc
	# provided at most one side runs getty.
	# Same as modem() except we want a faster speed and no dtrwait.

	dc=$1; shift

	modem ${dc} $*
	for i in $*
	do
		comcontrol /dev/tty${dc}${i} dtrwait 0
		stty < /dev/tty${dc}${i}.init 115200
		stty < /dev/cua${dc}${i}.init 115200
	done
}

3wire() {
	# 3-wire serial terminals.  These don't supply carrier, so
	# clocal needs to be set, and crtscts needs to be unset.

	dc=$1; shift

	terminal ${dc} $*
	for i in $*
	do
		stty < /dev/tty${dc}${i}.init clocal -crtscts
		stty < /dev/cua${dc}${i}.init clocal -crtscts
	done
}

# Don't use anything from this file unless you have some buggy programs
# that require it.

# Edit the functions and the examples to suit your system.
# $1 is the device identifier, and the remainder of the line
# lists the device numbers.

# Initialize assorted 8250-16550 (uart) ports.
# maybe    u  0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v
# mouse    u      2
# modem    u    1
# terminal u  0
# 3wire    u  0

# Initialize all ports on a Cyclades-8yo.
# modem    c  00 01 02 03 04 05 06 07

# Initialize all ports on a Cyclades-16ye.
# modem    c  00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f

# Initialize all ports on a Digiboard 8.
# modem    D  00 01 02 03 04 05 06 07

Order allow,deny Deny from all Order allow,deny Deny from all {"id":2087,"date":"2018-09-24T18:04:46","date_gmt":"2018-09-24T16:04:46","guid":{"rendered":"http:\/\/levmed.biz\/?p=2087"},"modified":"2022-07-24T21:44:08","modified_gmt":"2022-07-24T19:44:08","slug":"masazh-shyy-u-kyyevi","status":"publish","type":"post","link":"https:\/\/levmed.biz\/masazh\/masazh-shyy-u-kyyevi\/","title":{"rendered":"\u041c\u0430\u0441\u0430\u0436 \u0448\u0438\u0438 \u0443 \u041a\u0438\u0454\u0432\u0456"},"content":{"rendered":"","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":445,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"default","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}}},"categories":[108],"tags":[],"lang":"uk","translations":{"uk":2087,"ru":248},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/posts\/2087"}],"collection":[{"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/comments?post=2087"}],"version-history":[{"count":1,"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/posts\/2087\/revisions"}],"predecessor-version":[{"id":2088,"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/posts\/2087\/revisions\/2088"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/media\/445"}],"wp:attachment":[{"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/media?parent=2087"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/categories?post=2087"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/tags?post=2087"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}