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

learn more… | top users | synonyms (1)

2
votes
1answer
126 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
977 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 ...
2
votes
1answer
62 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
75 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
465 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
46 views

OSX - How can I copy a local users settings/preferences to a new mobile user

We are working on migrating all our local users to mobile accounts that are bound to LDAP. I am working on a script that prompts a user to enter their email and it creates a new mobile user and then ...
1
vote
1answer
95 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
228 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
67 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
50 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 ...
2
votes
0answers
119 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, ...
2
votes
0answers
124 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
179 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
56 views

Implementing and testing a Subversion hook

Background I'm trying to implement a number of commit hooks for Subversion. I have done a lot of research to try and get a simple test hook to work, however I have had no luck. For reference I have ...
1
vote
0answers
23 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
69 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
103 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
95 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
440 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
62 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
82 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
86 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
267 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
339 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
236 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
12 views

Disabling ssid broadcast programatically/CLI and keeping exsisting devices connected DD-wrt access point

I'm trying to disable/hide my SSID broadcast programatically in order to stop devices connecting to my access point (not for security reasons). I have tried renaming the SSID and setting it to nothing ...
0
votes
0answers
23 views

How to delete all ufw rules for a certain port?

I am using ansible to configure ufw on my DB servers to only let accept connections from certain servers connection to a specific port (lets say 1234). When a server that used to have access is taken ...
0
votes
0answers
24 views

Odd behaviour with varnishlog and stream redirecting

I wrote a helper to debug varnish installation and have used it on both production and development server. The odd thing is, I encountered different behaviour even though the setup is nearly identical ...
0
votes
0answers
11 views

Ctrl-C is ignored by pppd when put in a shell script

I'm trying to connect to GPRS network through a serial port connected GSM modem. When I call /usr/sbin/pppd call <peer_name> from the command line, It correctly receives and handles Ctrl+C from ...
0
votes
0answers
34 views

pam_exec not working? cannot allocate 2 bytes?

I am trying to run a script during the login process using PAM and libpam_exec; I have added this line to the desired file under /etc/pam.d/: auth required pam_exec.so debug log=/var/log/debug ...
0
votes
0answers
32 views

Refine grep look behind to avoid numbers

When I query docker images, I get this: #> docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE local/debian 7.5 172c7702a46f ...
0
votes
0answers
62 views

SSH chroot solution for Mutt

We have an environment tailored for our users to log in via ssh and instead of gaining access directly to a shell, users have a script in place of a shell. The script simply launches Mutt on the ...
0
votes
0answers
29 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
44 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
50 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
29 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
93 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
37 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
39 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
25 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
181 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
43 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
80 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
82 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
68 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
185 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
276 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
102 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
169 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
797 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 ...