diff options
| author | John Lee <john_lee@openmoko.org> | 2009-01-12 14:39:16 +0800 |
|---|---|---|
| committer | John Lee <john_lee@openmoko.org> | 2009-01-12 14:39:16 +0800 |
| commit | 366bf6043abfbbbfa98168548f42aa9aaf6c28b9 (patch) | |
| tree | ec24779b5ed382cbd3077595cd54a62fad4741c7 /packages/initscripts/files/functions | |
| parent | b4e78908d6ed0b4a142dabc9e72b1a81b7f3c581 (diff) | |
| parent | 5c898f6e20d5d27a1cc0747746d35f706fd6dfff (diff) | |
Merge commit 'origin/john_lee/fastboot-devel' into org.openembedded.dev
Diffstat (limited to 'packages/initscripts/files/functions')
| -rw-r--r-- | packages/initscripts/files/functions | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/initscripts/files/functions b/packages/initscripts/files/functions new file mode 100644 index 0000000000..fb9a914e4d --- /dev/null +++ b/packages/initscripts/files/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 +} |
