#StackBounty: #bash #redis #redis-sentinel Can't get redis-sentinel notification script to execute correctly

Bounty: 50

Installed latest version of redis/redis-sentinel (6.0.5) from Chris Lea PPA on Ububtu 20.04.

Created a notification script with the same path as suggested in the default conf.

Tested that the script can be executed as the redis user (using su).

Still getting script-error when I test a failover, etc.

No more ideas left, any suggestions?


Get this bounty!!!

#StackBounty: #bash #redis #redis-sentinel Can't get redis-sentinel notification script to execute correctly

Bounty: 50

Installed latest version of redis/redis-sentinel (6.0.5) from Chris Lea PPA on Ububtu 20.04.

Created a notification script with the same path as suggested in the default conf.

Tested that the script can be executed as the redis user (using su).

Still getting script-error when I test a failover, etc.

No more ideas left, any suggestions?


Get this bounty!!!

#StackBounty: #bash #redis #redis-sentinel Can't get redis-sentinel notification script to execute correctly

Bounty: 50

Installed latest version of redis/redis-sentinel (6.0.5) from Chris Lea PPA on Ububtu 20.04.

Created a notification script with the same path as suggested in the default conf.

Tested that the script can be executed as the redis user (using su).

Still getting script-error when I test a failover, etc.

No more ideas left, any suggestions?


Get this bounty!!!

#StackBounty: #bash #grep grep with PTR records and domain+TLD match

Bounty: 200

I’m trying to determine if the domain+TLD are present in a list, after running the host command for an IP.

My script looks like this:

while read ip; do
  PTR=$(host $ip | rev | cut -d" " -f1 | rev | sed 's/.$//')
  if grep -q "$PTR" list.txt
  then
    echo "Match in list"
  else
    echo "No match in list"
  fi
done <ips.txt

The list.txt will contain:

dns.google
shodan.io

If I run my script for 8.8.8.8, which returns dns.google the script works as expected. If I run it for 198.20.99.130 it will fail (not match) as the result is census4.shodan.io.

Is there a way I can have grep match only if the domain+TLD (in this case shodan.io) is in the list?

While census4.shodan.io should match the list.txt, a domain like shodan.io.example.net shouldn’t.


Get this bounty!!!

#StackBounty: #bash #redis #redis-sentinel Can't get redis-sentinel notification script to execute correctly

Bounty: 50

Installed latest version of redis/redis-sentinel (6.0.5) from Chris Lea PPA on Ububtu 20.04.

Created a notification script with the same path as suggested in the default conf.

Tested that the script can be executed as the redis user (using su).

Still getting script-error when I test a failover, etc.

No more ideas left, any suggestions?


Get this bounty!!!

#StackBounty: #bash #readline #vi-mode Insert the last argument in bash in vi mode without inserting a leading space

Bounty: 50

Using bash in the default (emacs) mode I get the following behavior when I hit Esc, ..

$ echo hello
hello
$ hello  # I hit `<ESC>.` to insert this

Note there is no space before the word hello that is inserted when I hit Esc, ..

If I switch to vi mode and configure . I do get a leading space:

$ set -o vi
$ bind -m vi-command ".":yank-last-arg
$ echo hello
hello
$  hello  # I hit `<ESC>.` to insert this. Note the leading space.

Is there any way to configure bash/readline to avoid this leading space?


Get this bounty!!!

#StackBounty: #bash #ssh #zsh #source Source a file after ssh login drops to prompt

Bounty: 50

One-liner question: How do I automatically source a remote file on remote host after logging in via SSH via a bastion host?

I need to source a file containing a list of aliases + shell user defined functions on a remote host after ssh-ing into it.

The file exists on remote maching in /tmp folder e.g. /tmp/my-rc

Searching other posts and internet I have found

ssh -t user@domain.com 'source /tmp/my-rc; bash -l'

The problem is that I do get a terminal, but none of the aliases are set since it’s a new bash shell’

Thinking, that the source should be done after the shell is attached, tried the below but this also doesn’t work. There is no error, I get the terminal but don’t think the file got sourced (verified by echoing dummy message from /tmp/my-rc file)

ssh -t user@domain.com 'bash -l; source /tmp/my-rc'

Even tried with ‘.’ instead of source, no luck.

Any help.

Note1: Bash or ZSH any shell solution would do.

Note2: The actuall ssh is via a proxy command i.e. a hop over bastion host (Just mentioning if it is relevant at all)

Note3: I don’t have privilage of a profile rc or bashrc or even a home directory on the remote host.


Get this bounty!!!

#StackBounty: #bash #redis #redis-sentinel Can't get redis-sentinel notification script to execute correctly

Bounty: 50

Installed latest version of redis/redis-sentinel (6.0.5) from Chris Lea PPA on Ububtu 20.04.

Created a notification script with the same path as suggested in the default conf.

Tested that the script can be executed as the redis user (using su).

Still getting script-error when I test a failover, etc.

No more ideas left, any suggestions?


Get this bounty!!!

#StackBounty: #bash #redis #redis-sentinel Can't get redis-sentinel notification script to execute correctly

Bounty: 50

Installed latest version of redis/redis-sentinel (6.0.5) from Chris Lea PPA on Ububtu 20.04.

Created a notification script with the same path as suggested in the default conf.

Tested that the script can be executed as the redis user (using su).

Still getting script-error when I test a failover, etc.

No more ideas left, any suggestions?


Get this bounty!!!

#StackBounty: #bash #redis #redis-sentinel Can't get redis-sentinel notification script to execute correctly

Bounty: 50

Installed latest version of redis/redis-sentinel (6.0.5) from Chris Lea PPA on Ububtu 20.04.

Created a notification script with the same path as suggested in the default conf.

Tested that the script can be executed as the redis user (using su).

Still getting script-error when I test a failover, etc.

No more ideas left, any suggestions?


Get this bounty!!!