Bash is the Bourne Again SHell, the successor to the classic Unix sh (shell).

learn more… | top users | synonyms (1)

2
votes
1answer
98 views

init script terminating with ssh session

We need to run pt-stalk on a handful of servers to keep an eye on mySQL, and I was sick of manually starting it every time the server rebooted. A little googling turned up an init script for pt-stalk, ...
2
votes
1answer
59 views

Supervisord unable to shutdown fcgi processes

I've managed to set up supervisord with fastcgi on a django project of mine, the problem is that when I make mi program stop, the server keeps running somehow, and my page keeps online. Here is my ...
2
votes
1answer
68 views

IBMi bash upgrade

I am trying to install rvm in PASE on IBMi (v7.1) but it is failing because it states bash version 3.2.25 is required. Running bash --version via CALL QP2TERM states I am running the following ...
2
votes
1answer
335 views

Calculate average of every 5 samples with rrdtool or other languages

I want to make an average of 5 samples and calculate a single value: Current output - I put resolution of 5 minutes but receive 5 samples: $ rrdtool fetch file.rrd AVERAGE -r 300 --start 1200000000 ...
1
vote
1answer
36 views

Bash script for updating multiple servers not accepting RSA keys

In my environment I manage about 10 Linux servers that require regular package updates. I have a script written to connect to each individually and run the update. Additionally, I have RSA keys ...
1
vote
1answer
47 views

Dovecot quota-warning.sh not being excecuted

I would like to run a custom script with dovecot once the user reaches certain percents of their quota. The issue is that no matter what I try dovecot does not seem to execute my bash script. ...
1
vote
1answer
51 views

What is the Linux command to get the current PPTP ip address?

I have a Linux script that allows me to route some traffic through a VPN interface, and other traffic (from different IP) through another interface. This is my script: echo "ip route del default via ...
1
vote
1answer
56 views

Start Unix screen, Run command, Detach

How can screen be used to start a new session and run a command within that session without killing that session? screen -S myScreenName runSomething I tried the above command and it says [screen ...
1
vote
1answer
30 views

cp/rsync command with destination as symlink to a directory

I am working on a cPanel backup solution at the moment. We are now informed about this exploit. Exploit : Full ROOT ACCESS to server 1.) create malicious file from, normal user account: mkdir root ...
1
vote
1answer
110 views

Using exclamation marks in bash expansion

In bash, I build a svn command as a string with username and password options dynamically added. Some users might have an exclamation mark in their password, which might result in the following: ...
1
vote
1answer
737 views

Linux- Permission denied?

I'm installing Neo4j server as a linux service, but when I install it, I get the following message: /sbin/insserv: Permission denied What is this? What should I do? I'm running everything with ...
1
vote
1answer
95 views

Remote rename of a file on Samba share via Bash script

I'm running a Bash script under Cygwin, but this question applies more broadly. I have a remote file: //someremoteserver/somefile.db That "//" path is under Cygwin--it's essentially a UNC pathname ...
1
vote
1answer
341 views

Problems in monitoring file age with nagios (command substitution in filename)

In my current nagios installation I check for the existence of a remote backup through NRPE. In particular, my remote nrpe.cfg (on a Ubuntu 8.x) is: ...
1
vote
1answer
146 views

export_bashrc() bash function to export .bashrc to a server

I am trying to write a bash function shown below.I am trying to scp my .bashrc to the target machine.I want to do modify the following function in the below two ways. 1.I want to enter the password ...
1
vote
1answer
184 views

Redhat 5 Upgrade / Sphinx Search Init Startup Hangs

I recently upgrade a VM to Redhat 5 and moved Sphinx Search to that server. For some reason when I try to start Sphinx, the startup script fails to push the searchd process to the background. I ...
2
votes
0answers
99 views

Continuous ping on proxy preventing https requests, why?

I hope someone can help me solve this mystery. I have a small linux box which is configured as a transparent proxy on my network. I'm trying to run a script at startup that does a continuous ping to ...
2
votes
0answers
148 views

How do I download the avatar image from an Active Directory server?

I'm using the ldapsearch.exe binary that was installed along with an Oracle client. It took awhile to tease out the arguments that it wanted, but I'm able to successfully connect to AD and parse out ...
1
vote
0answers
9 views

SNMPget and bash gives strange results (gauge32 values incorrect)

Reallly strange to me but here is the problem. If I use an SNMP client such as ManageEngineMibBrowser to query the appliance I get what look like reasonable Numbers: dpStatusMemoryStatusUsage.0 97 ...
1
vote
0answers
44 views

Ssh issues on Google Compute Engine

I've just updated a few servers to the newer version of the gce stack, and I've started having some ssh issues that I'm not quite sure how to fix. I've already looked into issues with the firewall, ...
1
vote
0answers
48 views

linebreaks between results in grep

I need to occasionally monitor a spider that I have running on my server. I'm testing it to see how many iterations of it are running concurrently and to see if any of them are hanging. I use this: ...
1
vote
0answers
44 views

SNMP error reporting to stdout

Why does net-snmp after "No Such Object available on this agent at this OID" errors exit with 0 and print the error message to STDOUT while other errors are printed to STDERR and have an exit status ...
1
vote
0answers
74 views

grep is inconsistently defaulting to grep -P?

I have a script that does some housekeeping that works perfectly well when invoked from an interactive shell, but did nothing when invoked by cron. To troubleshoot this I started a shell with a ...
1
vote
0answers
228 views

Can't write to other users “you have write permission turned off”

For some reason I'm not able to write to other users on my system. [root@hostname ~]# write write: you have write permission turned off. [root@hostname ~]# mesg y [root@hostname ~]# mesg is y ...
1
vote
0answers
42 views

use socat to provide password to bsign

I have many servers, where I deploy various binaries. For this purpose I use a script that packs them into archives, publishes to the local repository and then ssh-es to the target servers and ...
1
vote
0answers
59 views

error in killing tshark from shell script

I'm getting this error "* glibc detected * /usr/sbin/tshark: double free or corruption " while doing this, any idea why? #!/bin/bash trap 'my_exit; exit' SIGINT SIGQUIT count=0 /usr/sbin/tshark -i ...
1
vote
0answers
62 views

Trying to script rsync using pam_exec

I'm trying to write a bash script that will execute rsync when called by pam_exec. I've tried a couple different ways, and I'm not sure what I'm doing wrong. When I try to run the script at login by ...
1
vote
0answers
225 views

Generating jmeter .jmx files with shell and variables

I've been trying to find a way to mass generate jmeter xml config files based on my template and some variables I could define somewhere. Bash didn't work too well, I was trying while read line with ...
1
vote
0answers
271 views

Autocompletion, history and scrolling in Byobu

I am using an Ubuntu server with Byobu. For some reason, the tab key writes a tab instead of completing commands and paths. Top arrow writes ^[[A instead of the command history. Scrolling writes ^[[B. ...
1
vote
0answers
328 views

Running Hudson builds with a higher nice level

I want to run build jobs in Jenkins with minimal cpu usage. I've tried this: Created the directory "jenkinsJdk".Jenkins is configured to use this dir as JDK "testJdk". A sample job uses "testJdk" ...
1
vote
0answers
223 views

How to run script only if load balancer is NOT routing requests to it via bash script?

I have 4 cloud instances. First is a load balancer (LB), and then 2 instances with the identical setup holding the application code (APP1 & APP2). And finally, I have a database instance (DB). ...
0
votes
0answers
17 views

Script to apply Simple Finder restrictions to Mac OS X user?

Is it possible to script (e.g. with AppleScript or bash shell script) applying the Simple Finder and an associated application whitelist to a local user account on Mac OS X? We are using Mac OS X ...
0
votes
0answers
21 views

Wrong PATH in init script on boot

Since the update of the System on my Synology NAS (x86) i have some problems with my startup scripts. The Bash scripts are stored in /usr/local/etc/rc.d. The scripts were executed for sure, because i ...
0
votes
0answers
20 views

echo or copy file using distributed shell aka dsh

I'd like to copy a text file using distributed shell (aka dsh), but I'm having some trouble getting that done. I could just copy it like a normal file, but I don't want to because I'm trying to create ...
0
votes
0answers
18 views

Use tmux for managing multiple downloaders as a supervisorctl service?

I have many data-servers I need to download data from via http as soon as it is available. For each server I start a bash "while true"-loop and within that a wget to poll the server for new data. To ...
0
votes
0answers
48 views

Using Jekyll with Github webhooks for automated deployment

A little background first: I'm a designer and want to serve some static sites with Jekyll. So I grabbed a vps(ubuntu 12.04) and installed nginx, ruby and jekyll. I work from a few different ...
0
votes
0answers
33 views

Include executed cron command when outputting to log

Is there a way I can include the command in the output when I'm logging to a file? For example * * * * * date && /path/to/php /path/to/script.php >> cron.log 2>&1 Would give ...
0
votes
0answers
37 views

How can I detect if I have access for resource?

I'm trying to write bash script for file copying from local machine to FTP using lftp. Problem is, when someone enter inaccessible path for mkdir or put, then LFTP returns e.g.: Access failed: 550 ...
0
votes
0answers
22 views

Restarting Multiple Processes Running Via Screen If Any Are Using Abnormal CPU Resources

I'm running 4 CS 1.6 servers in 4 different screens, so I have 4 processes by the name of "hlds_run" with different process ids. Due to Valve being all-around terrible at porting their server code to ...
0
votes
0answers
117 views

expect: how to use expect scripts from within a bash subroutine

I want to write a login script in expect. But I want this to be reused in different other scripts. I want to make all the login commands part of a bash subroutine. ie instead of expect_login.sh ...
0
votes
0answers
32 views

bash redirections stalling when used with jstack

I have this command that is not working and I have no idea how to debug. The command it never returns and I have to press CTRL+C. diff <(jstack 13928) <(sleep 10;jstack 13928) I want to make ...
0
votes
0answers
66 views

Get an OpenVZ container's cpuload realtime in a bash script

I have a bash script which uses CPU cores rather intensively. Recently my VPS was suspended due to server load. The main reason is a cron job for a bash script which checks for Wordpress plugins and ...
0
votes
0answers
36 views

schroot auto-mounting doesnt works?

I've been reading about schroot and trying to understand the parts in various tutorials that mention about auto mounting. For example check the section (and the parts after it) "Basic schroot ...
0
votes
0answers
68 views

Installing keys with .DEB packages silently fails

I'm trying to create a .DEB package which will install a number of certificates and keys onto a system. To do this, i've gone through the standard package creation process, and thrown two files, ...
0
votes
0answers
67 views

How can I block all wordpress admin access on a server?

I administer a server with lot of wordpress installations. Is there a way to block all admin-accounts with one script, or to add an extra password in the global apache configuration? I would like to ...
0
votes
0answers
334 views

readlink: illegal option — f

Recently the script was working fine, but from some days I'm receiving such message, while running the readlink -f "$0" command: readlink: illegal option -- f usage: readlink [-n] [file ...] I was ...
0
votes
0answers
151 views

Different result with same grep conditions via ssh

Like in the subject I got different result from the same grep command. The following command is run on a central server which query the other servers via ssh. ssh root@$domain "grep `date +%Y/%m/%d` ...
0
votes
0answers
235 views

SELinux denies execute of script resulting in a complex looking custom policy

The heartbeat type polling tool nanny (part of Piranha / Linux Virtual Server / LVS / IPVS) is being denied access to my "sendprogram" scripts by SELinux. Setting the context alone is not sufficient. ...
0
votes
0answers
101 views

Remote call script as administrator

I created a Windows XP bat script to modify etc/hosts file. I want to share this script at other machine, then from another computer I want to invoke these script to modify hosts file at first ...
0
votes
0answers
162 views

scp in for loop for installing printers — connection refused

I could've sworn I was able to setup printers by: setup first host with lpadmin setup additional hosts with for loop: wherein stop cups copy printers.conf over start cups for host in ...
0
votes
0answers
718 views

ldap_delete issue: no global superior knowledge

I'm trying to remove all entries under a particular OU on an LDAP server. The command that I'm using is: sudo slapcat -v -n 1 -a ...