From 3cdc6aed8b5852249c1410f786acf84fcab8b153 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 13 Aug 2011 16:06:03 +0200 Subject: lib: add libkrebs.sh --- lib/Makefile | 9 +++++++++ lib/libkrebs.sh | 10 ++++++++++ 2 files changed, 19 insertions(+) create mode 100644 lib/Makefile create mode 100644 lib/libkrebs.sh (limited to 'lib') diff --git a/lib/Makefile b/lib/Makefile new file mode 100644 index 00000000..4d33995f --- /dev/null +++ b/lib/Makefile @@ -0,0 +1,9 @@ + + +.PHONY: all install +all: select-target + +install: ../bin/libkrebs.sh + +../bin/libkrebs.sh: libkrebs.sh + ln -vsnf ../lib/$< $@ diff --git a/lib/libkrebs.sh b/lib/libkrebs.sh new file mode 100644 index 00000000..d423a053 --- /dev/null +++ b/lib/libkrebs.sh @@ -0,0 +1,10 @@ +#! /bin/sh +esudo() { + if test "${esudo-true}" = true -a `id -u` != 0; then + echo "we're going sudo..." >&2 + export esudo=false + exec sudo "$0" "$@" + exit 23 # go to hell + fi +} + -- cgit v1.2.3