From 5f1598f6ae358806d8f526e1a3709a103e4caf1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Pinson?= Date: Thu, 2 Apr 2009 17:18:17 +0200 Subject: [PATCH] Added nb-users and uptime scripts. --- bin/nb-users | 23 +++++++++++++++++++++++ bin/uptime | 23 +++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100755 bin/nb-users create mode 100755 bin/uptime diff --git a/bin/nb-users b/bin/nb-users new file mode 100755 index 00000000..1fb1c9bc --- /dev/null +++ b/bin/nb-users @@ -0,0 +1,23 @@ +#!/bin/sh -e +# +# nb_users: print the number of users on the machine +# Copyright (C) 2009 Raphaël Pinson. +# +# Authors: Raphaël Pinson +# +# 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, either version 3 of the License, or +# (at your option) any later version. +# +# 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 . +# + +uptime | sed -e "s/.*, *\(.* user[s]*\), .*/\1/" + diff --git a/bin/uptime b/bin/uptime new file mode 100755 index 00000000..c4bb3422 --- /dev/null +++ b/bin/uptime @@ -0,0 +1,23 @@ +#!/bin/sh -e +# +# uptime: condensed uptime of the machine +# Copyright (C) 2009 Raphaël Pinson. +# +# Authors: Raphaël Pinson +# +# 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, either version 3 of the License, or +# (at your option) any later version. +# +# 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 . +# + +uptime | sed -e "s/.* up *\(.*\), *.* user[s]*, .*/\1/; s/ day[s]*, */d/" +