From 5e326f51c58e500285ea3daee91986ee1ea518eb Mon Sep 17 00:00:00 2001 From: root Date: Tue, 5 Nov 2013 13:24:42 +0100 Subject: sandbox -> .graveyard --- .graveyard/meta/bin/update | 15 +++++++++++++++ .graveyard/meta/install | 25 +++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100755 .graveyard/meta/bin/update create mode 100755 .graveyard/meta/install (limited to '.graveyard/meta') diff --git a/.graveyard/meta/bin/update b/.graveyard/meta/bin/update new file mode 100755 index 00000000..9b2289ad --- /dev/null +++ b/.graveyard/meta/bin/update @@ -0,0 +1,15 @@ +#! /bin/sh +set -euf + +cd $(dirname $(readlink -f $0))/../.. +id=`ls -lnd . | awk '{print$3}'` + +if test "${nosudo-false}" != true -a `id -u` != $id; then + echo "we're going sudo..." >&2 + exec sudo -u "#$id" "$0" "$@" + exit 23 # go to hell +fi + +echo "// is $PWD owned by $id" + +git pull diff --git a/.graveyard/meta/install b/.graveyard/meta/install new file mode 100755 index 00000000..07096b34 --- /dev/null +++ b/.graveyard/meta/install @@ -0,0 +1,25 @@ +#! /bin/sh +set -euf + +cd $(dirname $(readlink -f $0)) + +id=`ls -ld . | awk '{print$3}'` +update=$PWD/bin/update + +echo "#" +echo "# to install metastatic automatization facility do following:" +echo "#" +echo +echo " ln -vsn $update /update" +echo +if test -e /update; then + echo "# but beware: you already have an /update like this:" + ls -l /update +fi +echo "# then check if you can execute following with your current user:" +echo +echo " /update" +echo +echo "# if not then add that user to your sudoers... maybe something" +echo "# like this could work: `id -un` ALL=($id) NOPASSWD:/update" +echo "#^D" -- cgit v1.2.3