mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 06:23:19 -07:00
add GPLv3 header to all bin scripts
This commit is contained in:
parent
a1d556ef60
commit
d00c15e2c1
8 changed files with 144 additions and 0 deletions
|
@ -1,4 +1,22 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
#
|
||||||
|
# cpu-count: count cpu's on a systems
|
||||||
|
# Copyright (C) 2008 Canonical Ltd.
|
||||||
|
#
|
||||||
|
# Authors: Dustin Kirkland <kirkland@canonical.com>
|
||||||
|
#
|
||||||
|
# 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
count=`grep -c "^processor.*:" /proc/cpuinfo`
|
count=`grep -c "^processor.*:" /proc/cpuinfo`
|
||||||
if [ "$count" = "1" ]; then
|
if [ "$count" = "1" ]; then
|
||||||
|
|
18
bin/cpu-freq
18
bin/cpu-freq
|
@ -1,4 +1,22 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
#
|
||||||
|
# cpu-freq: calculate current cpu frequency
|
||||||
|
# Copyright (C) 2008 Canonical Ltd.
|
||||||
|
#
|
||||||
|
# Authors: Dustin Kirkland <kirkland@canonical.com>
|
||||||
|
#
|
||||||
|
# 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
mhz=`grep -m 1 "^cpu MHz" /proc/cpuinfo | sed "s/^.*: //" | sed "s/\..*$//"`
|
mhz=`grep -m 1 "^cpu MHz" /proc/cpuinfo | sed "s/^.*: //" | sed "s/\..*$//"`
|
||||||
if [ $mhz -ge 1000 ]; then
|
if [ $mhz -ge 1000 ]; then
|
||||||
|
|
|
@ -1,3 +1,21 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
#
|
||||||
|
# load-average: grab the current load average
|
||||||
|
# Copyright (C) 2008 Canonical Ltd.
|
||||||
|
#
|
||||||
|
# Authors: Dustin Kirkland <kirkland@canonical.com>
|
||||||
|
#
|
||||||
|
# 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
cat /proc/loadavg | cut -d " " -f -1
|
cat /proc/loadavg | cut -d " " -f -1
|
||||||
|
|
|
@ -1,4 +1,22 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
#
|
||||||
|
# mem-available: grab the current memory available
|
||||||
|
# Copyright (C) 2008 Canonical Ltd.
|
||||||
|
#
|
||||||
|
# Authors: Dustin Kirkland <kirkland@canonical.com>
|
||||||
|
#
|
||||||
|
# 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
mem=`free | grep -m 1 "^Mem:" | awk '{print $2}'`
|
mem=`free | grep -m 1 "^Mem:" | awk '{print $2}'`
|
||||||
if [ $mem -ge 1048576 ]; then
|
if [ $mem -ge 1048576 ]; then
|
||||||
|
|
18
bin/mem-used
18
bin/mem-used
|
@ -1,3 +1,21 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
#
|
||||||
|
# mem-used: grab the current memory used
|
||||||
|
# Copyright (C) 2008 Canonical Ltd.
|
||||||
|
#
|
||||||
|
# Authors: Dustin Kirkland <kirkland@canonical.com>
|
||||||
|
#
|
||||||
|
# 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
free | awk '/buffers\/cache:/ {printf "%.0f%%\n", 100*$3/($3 + $4)}'
|
free | awk '/buffers\/cache:/ {printf "%.0f%%\n", 100*$3/($3 + $4)}'
|
||||||
|
|
|
@ -1,4 +1,22 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
#
|
||||||
|
# reboot-required: determine if a reboot is required
|
||||||
|
# Copyright (C) 2008 Canonical Ltd.
|
||||||
|
#
|
||||||
|
# Authors: Dustin Kirkland <kirkland@canonical.com>
|
||||||
|
#
|
||||||
|
# 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
if [ -e /var/run/reboot-required ]; then
|
if [ -e /var/run/reboot-required ]; then
|
||||||
echo "(@)"
|
echo "(@)"
|
||||||
|
|
18
bin/release
18
bin/release
|
@ -1,3 +1,21 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
#
|
||||||
|
# release: grab the os/distro release
|
||||||
|
# Copyright (C) 2008 Canonical Ltd.
|
||||||
|
#
|
||||||
|
# Authors: Dustin Kirkland <kirkland@canonical.com>
|
||||||
|
#
|
||||||
|
# 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
/usr/bin/lsb_release -d -s | sed 's/\s*(.*)$//'
|
/usr/bin/lsb_release -d -s | sed 's/\s*(.*)$//'
|
||||||
|
|
|
@ -1,4 +1,22 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
#
|
||||||
|
# updates-available: calculate and cache the number of updates available
|
||||||
|
# Copyright (C) 2008 Canonical Ltd.
|
||||||
|
#
|
||||||
|
# Authors: Dustin Kirkland <kirkland@canonical.com>
|
||||||
|
#
|
||||||
|
# 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
# expire the cache in X seconds; 1 hour by default
|
# expire the cache in X seconds; 1 hour by default
|
||||||
EXPIRATION=3600
|
EXPIRATION=3600
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue