I was wondering if anyone could provide some assistance. I trying to run an expect script within bash and get the results of a variable called RESULT. I Have tried a few things but none of them have worked. I know that the child process (the expect script) in this instance cannot set a variable for the parent. (bash) and the value must be return by the expect script, that is my problem.
my script
any assistance is appreciated. thank you.
Last edited by vbe; 12-22-2014 at 03:56 PM..
Reason: code tags please...
I'm writing a script that'll send a time-stamp to my backup server. I create a file with the name of the current date, send it to my server with scp and rm the file from the local computer.
Individually these commands work fine and with a set name the expect scripts also work fine. The problem... (0 Replies)
Hi,
I'm primarily a Cisco/Juniper networking guy, so you'll have to forgive my ignorance when it comes to scripting (although I do write simple backup scripts and things of that nature on a regular basis and I run Linux at home, so I am vaguely familiar with it). What I need to do should be... (2 Replies)
Hi All,
I need to frame a unix script to logon to a unix box. The credentials needs to be obtained from a property file on the same location.
I am trying to use 'expect' and 'spawn' command to meet this req.
When I am passing values, these commands are working fine. but when I am trying to... (3 Replies)
Hi, I'm writing a shell script that calls a few commands that prompt the user for two simple yes/no questions. if the answers are consistent (the first is a yes, the second is a no), what would my expect script look like? Google is only giving me answers for scripts where I telnet or ssh. right now... (3 Replies)
I'm trying to make an expect function that will pass through a variable.
/usr/bin/expect<<EOD
spawn su -
expect "Password: "
send "$psswd\r"
expect "#"
send "/etc/init.d/network restart >>$log\r"
expect "#"
send "exit\r"
EOD
The $log passes through but my $psswd fails
I know... (1 Reply)
Sometimes it is handy to protect long scripts in C++.
The following syntax works fine for simple commands:
#define SHELLSCRIPT1 "\
#/bin/bash \n\
echo \"hello\" \n\
"
int main ()
{
cout <<system(SHELLSCRIPT1);
return 0;
}
Unfortunately for there are problems for:
1d arrays:... (10 Replies)
Dear all
Hi
I want use expect in bash so that we can not use these with each other
/bin/bash. With. /usr/bin/expect
How can use these with on script or how can call a script from other script
#!/bin/bash
clear
echo "================================== "
echo "Enter your Esxi IP"... (3 Replies)
im very happy to back for this forum
I have servers with alias of double dns extentions:
sample:
servera.test.com
servera.test1.com
serverb.test.com
serverb.test1.com
I need to login to that severs and executing the set of commands
if test.com failed then try to login via... (0 Replies)
Discussion started by: prakash0106
0 Replies
LEARN ABOUT SUSE
ocf_heartbeat_pure-ftpd
OCF_HEARTBEAT_PURE-(7) OCF resource agents OCF_HEARTBEAT_PURE-(7)NAME
ocf_heartbeat_Pure-FTPd - Manages a Pure-FTPd FTP server instance
SYNOPSIS
Pure-FTPd [start | stop | monitor | validate-all | meta-data]
DESCRIPTION
This script manages Pure-FTPd in an Active-Passive setup
SUPPORTED PARAMETERS
script
The full path to the Pure-FTPd startup script. For example, "/sbin/pure-config.pl" (optional, string, default /sbin/pure-config.pl)
conffile
The Pure-FTPd configuration file name with full path. For example, "/etc/pure-ftpd/pure-ftpd.conf" (optional, string, default
/etc/pure-ftpd/pure-ftpd.conf)
daemon_type
The Pure-FTPd daemon to be called by pure-ftpd-wrapper. Valid options are "" for pure-ftpd, "mysql" for pure-ftpd-mysql, "postgresql"
for pure-ftpd-postgresql and "ldap" for pure-ftpd-ldap (optional, string, no default)
pidfile
PID file (optional, string, default /var/run/resource-agents/pure-ftpd-default.pid)
SUPPORTED ACTIONS
This resource agent supports the following actions (operations):
start
Starts the resource. Suggested minimum timeout: 20s.
stop
Stops the resource. Suggested minimum timeout: 20s.
monitor
Performs a detailed status check. Suggested minimum timeout: 20s. Suggested interval: 60s.
validate-all
Performs a validation of the resource configuration. Suggested minimum timeout: 20s.
meta-data
Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5s.
EXAMPLE
The following is an example configuration for a Pure-FTPd resource using the crm(8) shell:
primitive example_Pure-FTPd ocf:heartbeat:Pure-FTPd
op monitor depth="0" timeout="20s" interval="60s"
SEE ALSO
http://www.linux-ha.org/wiki/Pure-FTPd_(resource_agent)
AUTHOR
Linux-HA contributors (see the resource agent source for information about individual authors)
resource-agents 1.0.3 07/05/2010 OCF_HEARTBEAT_PURE-(7)