Skip to content

Instantly share code, notes, and snippets.

@pamolloy
Last active January 23, 2019 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pamolloy/2d3003b3cc3a1440b076602595902992 to your computer and use it in GitHub Desktop.
Save pamolloy/2d3003b3cc3a1440b076602595902992 to your computer and use it in GitHub Desktop.
Irssi notifications

I keep running into the following issue:

Jan 23 15:48:52 localhost irssi-notify.bash[23391]: ssh_askpass: exec(/usr/libexec/openssh/ssh-askpass): No such file or directory
Jan 23 15:48:52 localhost irssi-notify.bash[23391]: user@host: Permission denied (publickey).

After I installed openssh-askpass I get prompted for the password for my key every time ssh is called in the script.

#!/usr/bin/env bash
set -xe
readonly fnotify_path="~/.irssi/fnotify"
remote_host="${1}"
tempdir=$(mktemp -d)
trap "rm -r ${tempdir}" EXIT
scp "${remote_host}":"${fnotify_path}" "${tempdir}"
ssh "${remote_host}" truncate -s 0 "${fnotify_path}"
while IFS="" read -r line; do
IFS=" " read network user msg <<< "${line}"
zenity --warning --title "Message from ${user} on ${network}" \
--text "${msg}" --width=300
done<"${tempdir}/fnotify"
[Unit]
Description=Check for irssi notifications
[Service]
Type=oneshot
ExecStart=/home/philip/repos/public/irssi-notify/irssi-notify.bash %i
[Unit]
Description=Check %i for irssi notifications
[Timer]
OnBootSec=1m
OnUnitActiveSec=1m
[Install]
WantedBy=timers.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment