nmap isn't quite that useful to test connections. You could install netcat and test the connection using the -z switch, eg
Or, if you have bash available and don't want to install anything else you could try replacing the netcat call with
But this is really, really fugly.
i have a unix script that gives me the sysdate from the database EDNAMID.WORLD.What i want my script to do the following
1) Establish a database connection
2) if database connection is successfull then echo the message "Connected"
3) put the o/p of the Sql query in a spool file
4) then... (3 Replies)
I am writing a script to do some conditional logic based on the results of a connection test. I need to capture the output of netcat, the 3 expected conditions are as follows. I need to capture the output of this command. I could write this to a file, but I would like to do it clearer if possible.... (1 Reply)
I want to test if my host can connect to any of the following 10 hosts (192.168.1.0 to 192.168.1.9)
I didnt know which command i should use, so i chose ping. (i wonder if i should use tracepath or sth else)
my code is the following:
#!/bin/bash
clear
firstPart="192.168.1"
maxNum="9"
... (2 Replies)
How do I gain control of the "Connection closed by foreign host" message telnet yields when you connect to it in a shell script? I'm using the output:
#!/usr/local/bin/bash
count=$(ping -c 1 $1 | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }')
if ; then
echo "$1 PING "... (2 Replies)
Hi,
I am running a shell script which will spawn the telnet and login.
But sometimes, the telnet session itself is not getting spawned.
My requirement is, if the telnet session is not spawned, the user must be notified that it failed.
Is there any command to capture the status of telnet... (2 Replies)
Hello;
I regularly run monitoring scripts over ssh to monitoring scripts
But whenever a server is hung or in maintenance mode, my script hangs..
Are there anyways to trap exit status and be on my way ??
Looked at the ssh manpage and all I can see is a "-q" option for quiet mode ..
Thank... (2 Replies)
Hello Everyone,
My following script is giving me problems, when the SIP trunk goes down and the telnet session is started and just when the command is about to complete the connection is closed then script restarts.
I have noticed that as soon the script types in "sys re" or "sys rebo" or... (6 Replies)
Hi there,
I'm very used to use set -e to break my scripts if any command exits with a non-zero status.
As a policy, I'm willingly expecting echo hello | grep a to break the script.
The commands test 1 -eq $1 && echo hello exits with a non-zero status if $1 is not 1. BUT... It doesn't break... (2 Replies)
Hello,
I'm trying to learn and automate some tasks via a script, but my first ever script failed with "connection closed by foreign host" error. I checked the other discussions but it didn't help. Could you please help?
#!/bin/bash
( sleep 2
echo open x.x.x.x 23
sleep 2
echo user
sleep 2... (1 Reply)
Discussion started by: Myrtle
1 Replies
LEARN ABOUT MINIX
kernel-install
KERNEL-INSTALL(8) kernel-install KERNEL-INSTALL(8)NAME
kernel-install - Add and remove kernel and initramfs images to and from /boot
SYNOPSIS
kernel-install COMMAND KERNEL-VERSION [KERNEL-IMAGE]
DESCRIPTION
kernel-install is used to install and remove kernel and initramfs images to and from /boot.
kernel-install will execute the files located in the directory /usr/lib/kernel/install.d/ and the local administration directory
/etc/kernel/install.d/. All files are collectively sorted and executed in lexical order, regardless of the directory in which they live.
However, files with identical filenames replace each other. Files in /etc/kernel/install.d/ take precedence over files with the same name
in /usr/lib/kernel/install.d/. This can be used to override a system-supplied executables with a local file if needed; a symbolic link in
/etc/kernel/install.d/ with the same name as an executable in /usr/lib/kernel/install.d/, pointing to /dev/null, disables the executable
entirely. Executables must have the extension ".install"; other extensions are ignored.
An executable should return 0 on success. It may also return 77 to cause the whole operation to terminate (executables later in lexical
order will be skipped).
COMMANDS
The following commands are understood:
add KERNEL-VERSION KERNEL-IMAGE
kernel-install creates the directory /boot/MACHINE-ID/KERNEL-VERSION/ and calls executables from /usr/lib/kernel/install.d/*.install
and /etc/kernel/install.d/*.install with the arguments
add KERNEL-VERSION
/boot/MACHINE-ID/KERNEL-VERSION/ KERNEL-IMAGE
The kernel-install plugin 50-depmod.install runs depmod for the KERNEL-VERSION.
The kernel-install plugin 90-loaderentry.install copies KERNEL-IMAGE to /boot/MACHINE-ID/KERNEL-VERSION/linux. It also creates a boot
loader entry according to the boot loader specification in /boot/loader/entries/MACHINE-ID-KERNEL-VERSION.conf. The title of the entry
is the PRETTY_NAME parameter specified in /etc/os-release or /usr/lib/os-release (if the former is missing), or "Linux KERNEL-VERSION",
if unset. If the file initrd is found next to the linux file, the initrd will be added to the configuration.
remove KERNEL-VERSION
Calls executables from /usr/lib/kernel/install.d/*.install and /etc/kernel/install.d/*.install with the arguments
remove KERNEL-VERSION /boot/MACHINE-ID/KERNEL-VERSION/
kernel-install removes the entire directory /boot/MACHINE-ID/KERNEL-VERSION/ afterwards.
The kernel-install plugin 90-loaderentry.install removes the file /boot/loader/entries/MACHINE-ID-KERNEL-VERSION.conf.
EXIT STATUS
If every executable returns 0 or 77, 0 is returned, and a non-zero failure code otherwise.
FILES
/usr/lib/kernel/install.d/*.install /etc/kernel/install.d/*.install
Drop-in files which are executed by kernel-install.
/etc/kernel/cmdline /proc/cmdline
The content of the file /etc/kernel/cmdline specifies the kernel command line to use. If that file does not exist, /proc/cmdline is
used.
/etc/machine-id
The content of the file specifies the machine identification MACHINE-ID.
/etc/os-release /usr/lib/os-release
The content of the file specifies the operating system title PRETTY_NAME.
SEE ALSO machine-id(5), os-release(5), Boot loader specification[1]
NOTES
1. Boot loader specification
https://www.freedesktop.org/wiki/Specifications/BootLoaderSpec
systemd 237KERNEL-INSTALL(8)