diff options
author | Stefan Schmidt <stefan@datenfreihafen.org> | 2009-09-17 18:01:23 +0000 |
---|---|---|
committer | Stefan Schmidt <stefan@datenfreihafen.org> | 2009-09-17 18:38:25 +0000 |
commit | e8622747c60b148e94f095c4bb7fe40fc52bba0a (patch) | |
tree | 76274bb2dfc0fdc63e419144deccc3a85a087378 /recipes/shr/initscripts-shr/functions | |
parent | 80c55c2574e99f025d88608966b09fcc578ed4f5 (diff) |
initscripts-shr: Add SHR initscripts (from SHR)
Diffstat (limited to 'recipes/shr/initscripts-shr/functions')
-rw-r--r-- | recipes/shr/initscripts-shr/functions | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/recipes/shr/initscripts-shr/functions b/recipes/shr/initscripts-shr/functions new file mode 100644 index 0000000000..fb9a914e4d --- /dev/null +++ b/recipes/shr/initscripts-shr/functions @@ -0,0 +1,17 @@ +# -*-Shell-script-*- +# +# functions This file contains functions to be used by most or all +# shell scripts in the /etc/init.d directory. +# + +machine_id() { # return the machine ID + awk 'BEGIN { FS=": " } /Hardware/ { gsub(" ", "_", $2); print tolower($2) } ' </proc/cpuinfo +} + +killproc() { # kill the named process(es) + pid=`/bin/ps -e x | + /bin/grep $1 | + /bin/grep -v grep | + /bin/sed -e 's/^ *//' -e 's/ .*//'` + [ "$pid" != "" ] && kill $pid +} |