COMMANDS

/bin/kugenpasswd
	encript password: get a string from stind (the password) and
	returns on stdout the string crypted using various algorithms:
	SSHA, SMDC5, crypt, SHA, MD5; usefull whenever you need to
	manually place an encrypted password somewhere

/bin/kusysinfo
	produces a system summary info

/bin/uidfree
	returns the next free user id given a starting one: searchs
	users database (getent passwd)

/sbin/in_chroot
	dirty hack to check if we are running in a chrooted environment,
	is not 100% proof, but still usefull


LIBRARY FILES, SHELL FUNCTIONS
------------------------------

You need to include this files using ". /lib/ku-base/xxxxx.sh" on top of your
bash shell scripts to use them.

/lib/ku-base/libfiles.sh
  ku_get_template
  	given that your tool, script, command name is into the $TOOLKIT
	env var, search a (template) file in /etc/$TOOLKIT/templates
	or /usr/share/$TOOLKIT/templates

/lib/ku-base/lock.sh
  ku_lock [file]
  	set a lock writing the current pid ($$) into the file "file" or
	$KU_LOCKFILE if "file" is not provided

  ku_lock_remove [file]
  	removes a lockfile ("file" or $KU_LOCKFILE)

  ku_lock_is_active [file]
	check if a lock is active or not: if the file "file" or
	$KU_LOCKFILE is present, it should contain the pid of a process,
	stale processes are detected (pid referring to a non existent
	process, removes the lockfile in such case), returns true if the
	lock is still active, false otherway

/lib/ku-base/log.sh
  ku_cap_logfile [file]
  	create the logfile "file" if not exists, checks for size and
	rotates it if over the limit (using logrotate); if you don't
	pass "file" argument, you must set the env var LOGFILE; if
	you pass it, the function will set if for you

  ku_log "string"
  	writes "string" into the logfile, with timestamp; if $LOGSYSLOG
	is true, writes "string" to system log using /usr/bin/logger

  ku_loglines [lines]
  	writes multiple lines to logfile, from arguments or from stdin

  env vars used by this functions:

    LOGFILE	filename (mandatory)
    LOGTAG	string, each line is preceeded by this tag (optional)
    LOGSIZE	max size, in K (default: 10240)
    LOGUSER	used when a new logfile is created, default: root
    LOGGROUP	group for a new logfile, default: adm
    LOGMODE	mode for a new logfile, default: 644
    LOGSYSLOG	true/false, default: true

BASH STARTUP FILES
------------------

We modify your system startup files for bash and compatible shells,
/etc/bash.bashrc and /etc/profile, to include content of snippets
from /etc/profile.d and /etc/profile-post.d:

  /etc/profile.d
  	a widely used convention to setup your environment on bash
	startup, the snippets are sourced before your custom
	$HOME/.bashrc 

  /etc/profile-post.d
  	similar of profile.d, but I added this directory to place
	actions that MUST be run AFTER any other system wide
	inclusion; $HOME/.bashrc is still sourced after this

about the latter directory: if you need to change some system
env settings without messing the standard system files, you
have no choice, eg: umask setting, is hardwired into system
startup files; to minimize the entropy, I modified only the
main bash startup file creating an hook AFTER the system
tasks

into the examples directory you will find a couple of snippets
that I use on my systems: umask.sh and silent-beep.sh



EXAMPLE FILES
-------------

  vimrc.local
  	my personal vim settings: no backup, autoindent, syntax on,
	showmatch, incremental search, etc; copy it to /etc/vim to
	use

silent-beep.sh, umask.sh
	/etc/profile-post.d snippets

