From d00c15e2c119b8e3030e19a5916b756a9bf4448a Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Wed, 4 Feb 2009 09:57:26 +0100 Subject: [PATCH] add GPLv3 header to all bin scripts --- bin/cpu-count | 18 ++++++++++++++++++ bin/cpu-freq | 18 ++++++++++++++++++ bin/load-average | 18 ++++++++++++++++++ bin/mem-available | 18 ++++++++++++++++++ bin/mem-used | 18 ++++++++++++++++++ bin/reboot-required | 18 ++++++++++++++++++ bin/release | 18 ++++++++++++++++++ bin/updates-available | 18 ++++++++++++++++++ 8 files changed, 144 insertions(+) diff --git a/bin/cpu-count b/bin/cpu-count index c45e0ef9..aa76cc37 100755 --- a/bin/cpu-count +++ b/bin/cpu-count @@ -1,4 +1,22 @@ #!/bin/sh -e +# +# cpu-count: count cpu's on a systems +# Copyright (C) 2008 Canonical Ltd. +# +# Authors: Dustin Kirkland +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + count=`grep -c "^processor.*:" /proc/cpuinfo` if [ "$count" = "1" ]; then diff --git a/bin/cpu-freq b/bin/cpu-freq index fa38eff2..3b92a3ad 100755 --- a/bin/cpu-freq +++ b/bin/cpu-freq @@ -1,4 +1,22 @@ #!/bin/sh -e +# +# cpu-freq: calculate current cpu frequency +# Copyright (C) 2008 Canonical Ltd. +# +# Authors: Dustin Kirkland +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + mhz=`grep -m 1 "^cpu MHz" /proc/cpuinfo | sed "s/^.*: //" | sed "s/\..*$//"` if [ $mhz -ge 1000 ]; then diff --git a/bin/load-average b/bin/load-average index f698095e..0e3d933e 100755 --- a/bin/load-average +++ b/bin/load-average @@ -1,3 +1,21 @@ #!/bin/sh -e +# +# load-average: grab the current load average +# Copyright (C) 2008 Canonical Ltd. +# +# Authors: Dustin Kirkland +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + cat /proc/loadavg | cut -d " " -f -1 diff --git a/bin/mem-available b/bin/mem-available index cd3b9319..62c2ee2c 100755 --- a/bin/mem-available +++ b/bin/mem-available @@ -1,4 +1,22 @@ #!/bin/sh -e +# +# mem-available: grab the current memory available +# Copyright (C) 2008 Canonical Ltd. +# +# Authors: Dustin Kirkland +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + mem=`free | grep -m 1 "^Mem:" | awk '{print $2}'` if [ $mem -ge 1048576 ]; then diff --git a/bin/mem-used b/bin/mem-used index 9944fcc3..f0be431a 100755 --- a/bin/mem-used +++ b/bin/mem-used @@ -1,3 +1,21 @@ #!/bin/sh -e +# +# mem-used: grab the current memory used +# Copyright (C) 2008 Canonical Ltd. +# +# Authors: Dustin Kirkland +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + free | awk '/buffers\/cache:/ {printf "%.0f%%\n", 100*$3/($3 + $4)}' diff --git a/bin/reboot-required b/bin/reboot-required index e13a93d9..08846195 100755 --- a/bin/reboot-required +++ b/bin/reboot-required @@ -1,4 +1,22 @@ #!/bin/sh -e +# +# reboot-required: determine if a reboot is required +# Copyright (C) 2008 Canonical Ltd. +# +# Authors: Dustin Kirkland +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + if [ -e /var/run/reboot-required ]; then echo "(@)" diff --git a/bin/release b/bin/release index a7be71b8..68a39ab0 100755 --- a/bin/release +++ b/bin/release @@ -1,3 +1,21 @@ #!/bin/sh -e +# +# release: grab the os/distro release +# Copyright (C) 2008 Canonical Ltd. +# +# Authors: Dustin Kirkland +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + /usr/bin/lsb_release -d -s | sed 's/\s*(.*)$//' diff --git a/bin/updates-available b/bin/updates-available index 5343b750..c53e8894 100755 --- a/bin/updates-available +++ b/bin/updates-available @@ -1,4 +1,22 @@ #!/bin/sh -e +# +# updates-available: calculate and cache the number of updates available +# Copyright (C) 2008 Canonical Ltd. +# +# Authors: Dustin Kirkland +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + # expire the cache in X seconds; 1 hour by default EXPIRATION=3600