Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=systemd.git;a=commitdiff;h=24060c6238cad0e5f80ec4d512aed7d4fa22cccd

commit 24060c6238cad0e5f80ec4d512aed7d4fa22cccd
Author: bouleetbil <bouleet...@frogdev.info>
Date:   Tue Nov 23 21:31:56 2010 +0000

systemd-13-1-i686
*forgot to commit functions

diff --git a/source/base/systemd/functions b/source/base/systemd/functions
new file mode 100644
index 0000000..ddb8a7c
--- /dev/null
+++ b/source/base/systemd/functions
@@ -0,0 +1,124 @@
+#!/bin/bash
+
+# (c) 2005 Marcus Habermehl <bmh198...@yahoo.de>
+# (c) 2004 Vajna Miklos <vmik...@frugalware.org>
+# functions for Frugalware
+# distributed under GPL License
+
+TEXTDOMAIN=functions
+TEXTDOMAINDIR=/lib/initscripts/messages
+
+hint()
+{
+       echo -e "\e[01;33m>>\e[0m $1"
+}
+
+msg()
+{
+       echo -ne "\e[01;36m::\e[0m \e[01m$1\e[0m"
+}
+
+ok()
+{
+       if [[ "$(echo $LANG | cut -d _ -f 1)" == "de" ]] ; then
+               cols=$(($(tput cols) - 14))
+       else
+               cols=$(($(tput cols) - 10))
+       fi
+
+       case $1 in
+               0|997) retval=32m ;;
+               999)   retval=33m ;;
+               *)     retval=31m ;;
+       esac
+
+       if (( $1 == 0 )) ; then
+               retmsg=$"   OK   "
+       elif (( $1 == 997 )) ; then
+               retmsg=$"   ON   "
+       elif (( $1 == 998 )) ; then
+               retmsg=$"  OFF   "
+       elif (( $1 == 999 )) ; then
+               retmsg=$"SKIPPING"
+       else
+               retmsg=$" FAILED "
+       fi
+
+       echo -ne $'\e['$cols$'G\e[01m[\e[01;'$retval
+       echo -n "$retmsg"
+       echo -e '\e[0;39m\e[01m]\e[0m'
+}
+
+rc_exec()
+{
+       if declare -f rc_$1 > /dev/null && \
+       echo "${actions[*]} help" | grep -q $1 ; then
+               rc_$1
+       else
+               rc_help && exit 1
+       fi
+}
+
+rc_help()
+{
+       actions=$(echo ${actions[*]} | tr ' ' '|')
+       msg $"Please use $0 $actions"
+       ok 1
+}
+
+rc_restart()
+{
+       rc_stop && sleep 1 && rc_start
+}
+
+rc_status()
+{
+       status_msg
+       if [[ "$(eval $pid)" == "" ]] ; then
+               ok 998
+               exit 1
+       else
+               ok 997
+               exit 0
+       fi
+}
+
+start_msg()
+{
+       if [ ! -z "${daemon}" ] ; then
+               msg $"Starting $daemon"
+       else
+               msg "$@"
+       fi
+}
+
+status_msg()
+{
+       if [ ! -z "${daemon}" ] ; then
+               msg $"$daemon is"
+       else
+               msg "$@"
+       fi
+}
+
+stop_msg()
+{
+       if [ ! -z "${daemon}" ] ; then
+               msg $"Stopping $daemon"
+       else
+               msg "$@"
+       fi
+}
+
+# backward compatibility
+start()
+{
+       msg "$1"
+}
+
+stop()
+{
+       msg "$1"
+}
+
+# vim: ft=sh
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to