Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 2381 Details for
Bug 4793
socklog-0.9.1.ebuild (New package)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
socklog control file
socklogctl (text/plain), 3.81 KB, created by
Stoyan Zhekov (RETIRED)
on 2002-07-19 09:06:56 UTC
(
hide
)
Description:
socklog control file
Filename:
MIME Type:
Creator:
Stoyan Zhekov (RETIRED)
Created:
2002-07-19 09:06:56 UTC
Size:
3.81 KB
patch
obsolete
>#!/bin/bash > ># ># source functions.sh for einfo, eerror and ewarn >. /sbin/functions.sh > >control() { > while : > do > clear > echo > einfo "socklog control" > echo > echo ">>> More information on this package can be found at" > echo ">>> http://smarden.org/socklog/" > echo > einfo "What to do?" > echo "[a] add service" > echo "[r] remove service" > echo "[s] services status" > echo "[q] quit" > echo > read -p "[q]> " myaction > > if [ "${myaction}" == "" ] > then > myaction="q" > fi > > if [ "${myaction}" != "a" ] && [ "${myaction}" != "r" ] && \ > [ "${myaction}" != "s" ]; then > exit 0 > fi > if [ "${myaction}" == "a" ]; then > action="add" > elif [ "${myaction}" == "r" ]; then > action="remove" > else # action=status > for svc in `ls -d /service/socklog-* 2>/dev/null`; do > svc-status `basename ${svc}` > done > if [ -d /etc/socklog/notify ]; then > echo "Notify enabled for loggrp" > fi > wait_key > continue > fi > echo > einfo "Available services: " > echo "[1] unix : /dev/log, replace socklogd" > echo "[2] inet : UDP 0.0.0.0:514, replace socklogd" > echo "[3] klog : /dev/klog or /proc/klog, replace klogd" > echo "[4] ucspi-tcp : TCP 0.0.0.0:10116, (need tcpserver from ucspi-tcp)" > echo "[5] notify : log events notification" > echo "[6] quit : return to main menu" > echo > echo -n "${action} service [1-5]: " > echo > read -p "[6]> " myservice > echo > > if [ "$myservice" == "" ] > then > myservice="6" > fi > > case $myservice in > 1) svc="unix";log="";; > 2) svc="inet";log="-inet";; > 3) svc="klog";log="-klog";; > 4) svc="ucspi-tcp";log="-ucspi-tcp";; > 5) svc="notify";log="/.notify";; > 6) continue;; > *) eerror "unknown service"; > wait_key > continue;; > esac > > > if [ ${svc} == "unix" ] && [ ! -S /dev/log ]; then > eerror "Device /dev/log does not exists!" > wait_key > continue > fi > > if [ ${svc} == "klog" ] && [ ! -S /dev/klog ]; then > eerror "Device /dev/klog does not exists!" > wait_key > continue > fi > > # ucspi-tcp need tcpserver from the sys-apps/ucspi-tcp > if [ ${svc} == "ucspi-tcp" ] && [ ! -x /usr/bin/tcpserver ] && \ > [ ${action} == "add" ]; then > eerror "Please emerge sys-apps/ucspi-tsp first" > wait_key > continue > fi > > # notify need unix socklog > if [ ${svc} == "notify" ] && [ ! -d /var/log/socklog ] && \ > [ ${action} == "add" ]; then > eerror "Please add [1] unix socklog first" > wait_key > continue > fi > > retval=0 > > if [ ${action} = "add" ]; then > add_svc ${svc} > retval=$(( ${retval} + $? )) > else # action = remove > # notify depends from unix > if [ ${svc} = "unix" ] && [ -d /etc/socklog/notify ]; then > eerror "Please remove notify first" > wait_key > continue > fi > remove_svc ${svc} ${log} > retval=$(( ${retval} + $? )) > fi > eend ${retval} "Failed to ${action} ${svc}" > wait_key > done >} > >add_svc() { > retval=0 > if [ ! -d /etc/socklog/${1} ]; then > if [ ${1} == "notify" ]; then > socklog-conf notify socklog loggrp > retval=$(( ${retval} + $? )) > else > socklog-conf ${1} nobody socklog > retval=$(( ${retval} + $? )) > fi > else > ewarn "already added" > fi > if [ ${1} != "notify" ]; then > if [ ! -h /service/socklog-${1} ]; then > svc-add /etc/socklog/${1} socklog-${1} > retval=$(( ${retval} + $? )) > else > ewarn "already started" > fi > fi > ebegin "Adding ${svc}..." > return ${retval} >} > >remove_svc() { > retval=0 > if [ -d /etc/socklog/${1} ]; then > if [ ${1} != "notify" ] && [ -h /service/socklog-${1} ] > then > svc-stop socklog-${1} > retval=$(( ${retval} + $? )) > svc-remove socklog-${1} > retval=$(( ${retval} + $? )) > fi > rm -rf /etc/socklog/${1} > retval=$(( ${retval} + $? )) > rm -rf /var/log/socklog${2} > retval=$(( ${retval} + $? )) > ebegin "Removing ${1}..." > else > eerror "removing impossible" > fi > return ${retval} >} > >wait_key() { > echo -n ">>> Press any key..." > read >} > ># check for root user! >if [ `id -u` -ne 0 ] >then > eerror "${0}: must be root." > exit 1 >fi > >control
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 4793
:
2101
| 2381 |
2595