dot

packages and services management
Log | Files | Refs | README

commit 2cabfe396d2b85d16632e515f8dd0dac71e003a1
parent 4bb5a9045c1d7158d741880eb0fa10c9bfbd863c
Author: josuah <mail@josuah.net>
Date:   Mon,  2 Jan 2017 18:48:27 +0100

Added ii-server

Diffstat:
A.local/bin/ii-server | 61+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
M.local/share/build/iomenu | 2+-
M.mailrc | 1+
3 files changed, 63 insertions(+), 1 deletion(-)

diff --git a/.local/bin/ii-server b/.local/bin/ii-server @@ -0,0 +1,61 @@ +# connect to an irc server with ii and maintain connection active + + +DIR="$HOME/.cache/irc" +LOG="$DIR/errors" + + +usage() +{ + printf '%s [-n NICK] [-f FULLNAME] SERVER...\n' "${0##*/}" +} + + +# 1: irc channel to connect to +# 2: nick name +# 3: full name + +connect() +{ + if pgrep -f "^ii .*-s $1" > /dev/null + then + printf '\033[31m%s: \033[1malreadiy running\033[m\n' "$1" + else + (exit 2) + while [ "$?" -eq 2 ] + do nohup ii -i "$DIR" -n "$2" -f "$3" -p 6667 -s "$1" 2> "$LOG" + done & + fi +} + + +main() +{ + [ $# -eq 0 ] && usage + while [ $# -gt 0 ] + do + case "$1" in + ( -n ) + NICK="$2" + shift + ;; + ( -f ) + FULL="$2" + shift + ;; + ( -* ) + usage + ;; + ( * ) + connect "$1" "${NICK:-$USER}" "${FULL:-${NICK:-$USER}}" + ;; + esac + shift + done + + pgrep -fl '^ii ' + return 1 +} + + +main "$@" diff --git a/.local/share/build/iomenu b/.local/share/build/iomenu @@ -1,3 +1,3 @@ # Input/Output interactive menu and completion engine. -tar=http://repo.or.cz/iomenu.git/snapshot/18566ed8b2e1020180c8b73e4bca1d5779cc4e54.tar.gz +tar=http://repo.or.cz/iomenu.git/snapshot/e244fd10ca3775b1f1d70aa3eaf33173d27e638b.tar.gz diff --git a/.mailrc b/.mailrc @@ -1,5 +1,6 @@ # mailx configuration file + set sendmail="~/.local/sbin/ssmtp" # Do not save message to mbox