dot

packages and services management
Log | Files | Refs | README

commit beb33ba673a19c19fefbf319f41a040bd0c04825
parent 571977c6d4657ecd8c345cd19598378b52df0584
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sat, 10 Feb 2018 11:53:59 +0100

[del] simplify daemon and rename it run

Diffstat:
Dbin/daemon | 33---------------------------------
Mbin/pack | 11+++++------
Abin/run | 9+++++++++
Mdot/profile | 8++------
Mdot/xinitrc | 1-
Rdaemon/collectd -> run/collectd | 0
Rdaemon/crond -> run/crond | 0
Rdaemon/geomyidae -> run/geomyidae | 0
Rdaemon/git -> run/git | 0
Rdaemon/ii -> run/ii | 0
Rdaemon/inetd -> run/inetd | 0
Rdaemon/ngircd -> run/ngircd | 0
Rdaemon/opentracker -> run/opentracker | 0
Rdaemon/quark -> run/quark | 0
Rdaemon/ratox -> run/ratox | 0
Rdaemon/ssh-agent -> run/ssh-agent | 0
Rdaemon/tincd -> run/tincd | 0
Rdaemon/tor -> run/tor | 0
18 files changed, 16 insertions(+), 46 deletions(-)

diff --git a/bin/daemon b/bin/daemon @@ -1,33 +0,0 @@ -#!/bin/sh - -mkdir -p "${LOG}" - -case "${1}" in -('') - find "${ETC}/daemon" -type f -mindepth 1 | sort | sed 's|.*/||' | - while IFS='' read -r service - do - printf '%-14s: %s\n' "${service}" \ - "$(pgrep -x "${service}" | tr '\n' ' ')" - done - ;; -(start) - service="${2}" - shift 2 - - [ -f "${ETC}/daemon/${service}" ] || - exec printf '%s: no script found\n' "${service}" - - "${ETC}/daemon/${service}" "$@" - - printf '%-14s: %s\n' "${service}" \ - "$(pgrep -x "${service}" | tr '\n' ' ')" - ;; -(stop) - pkill -x "${2}" - printf '%-14s: %s\n' "${1}" "$(pgrep -x "${1}" | tr '\n' ' ')" - ;; -(*) - printf 'usage: daemon [start <service> | stop <service>]\n' - ;; -esac diff --git a/bin/pack b/bin/pack @@ -1,9 +1,8 @@ #!/bin/sh -e -export SYS="${HOME}/.local" -export PKG="${HOME}/etc/pack/${2}" -export SRC="${HOME}/.local/src/${2}" -export OPT="${HOME}/.local/opt/${2}" +export PKG="${CFG}/pack/${2}" +export SRC="${SYS}/src/${2}" +export OPT="${SYS}/opt/${2}" export CFLAGS="-I'${SYS}/include'" export LDFLAGS="-L'${SYS}/lib'" @@ -59,8 +58,8 @@ case "${1}" in -type l -exec rm {} + ;; (*) - echo 'usage: pack tar | git | get | build | add | del <package>' + echo 'usage: pack tar | git | get | build | add | del <package>' echo '' - COLUMNS=80 ls -C "${HOME}/etc/pack" + COLUMNS=80 ls "${CFG}/pack" ;; esac diff --git a/bin/run b/bin/run @@ -0,0 +1,9 @@ +#!/bin/sh + +mkdir -p "${LOG}" + +[ "${#}" -ge 1 ] && exec "${CFG}/run/$@" + +ls "${CFG}/run" +printf '\n' +ls "${CFG}/run" | sed 's|.*/||' | xargs -n 1 -I {} pgrep -lf {} diff --git a/dot/profile b/dot/profile @@ -25,8 +25,8 @@ export LOG="${VAR}/log" # /var/log log files export MAIL="${VAR}/mail/mbox" export PLAN9="${SYS}/src/plan9" -export PATH="${HOME}/etc/bin:${HOME}/.local/bin:${PATH}:${PLAN9}/bin" -export MANPATH="${HOME}/etc/man:/usr/share/man:/usr/local/man" +export PATH="${CFG}/bin:${HOME}/.local/bin:${PATH}:${PLAN9}/bin" +export MANPATH="${CFG}/man:/usr/share/man:/usr/local/man" export MANPATH="${SYS}/share/man:${MANPATH}:${PLAN9}/man" export C_INCLUDE_PATH="${SYS}/include" export LIBRARY_PATH="${SYS}/lib:/usr/local/lib/inotify" @@ -42,7 +42,3 @@ export LESS='-R~X' export LESSHISTFILE='-' export SSH_AUTH_SOCK="${RUN}/ssh-agent" export EXINIT='set ruler' - -export PS1='$([ "${?}" -gt 0 ] && printf "\033[31;1mx\033[m\n\r")' -export PS1="${PS1}$(printf '\033]0;%s\a' '${PWD}') -$(uname -n)$([ "$(whoami)" = 'root' ] && printf '#' || printf '$') " diff --git a/dot/xinitrc b/dot/xinitrc @@ -1,6 +1,5 @@ setxkbmap us -option compose:ralt xsetroot -solid '#000000' -#xset +fp "$HOME/etc/fonts" while sleep 10 do xsetroot -name "$(status)" diff --git a/daemon/collectd b/run/collectd diff --git a/daemon/crond b/run/crond diff --git a/daemon/geomyidae b/run/geomyidae diff --git a/daemon/git b/run/git diff --git a/daemon/ii b/run/ii diff --git a/daemon/inetd b/run/inetd diff --git a/daemon/ngircd b/run/ngircd diff --git a/daemon/opentracker b/run/opentracker diff --git a/daemon/quark b/run/quark diff --git a/daemon/ratox b/run/ratox diff --git a/daemon/ssh-agent b/run/ssh-agent diff --git a/daemon/tincd b/run/tincd diff --git a/daemon/tor b/run/tor