From cff7c75150454226b8cbb77f3daf6fdabd8a28eb Mon Sep 17 00:00:00 2001 From: krebs Date: Tue, 8 Nov 2011 17:12:25 -0500 Subject: // magic: shuffle args --- census/sched-arping | 2 +- util/bin/magic | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/census/sched-arping b/census/sched-arping index d281cac3..14f8af3c 100755 --- a/census/sched-arping +++ b/census/sched-arping @@ -4,5 +4,5 @@ TMP=`mktemp` crontab -l >$TMP echo "23 * * * * $PWD/arping_users.py > $PWD/../db/arping" | -../util/bin/magic "arping" create $TMP +../util/bin/magic create "arping" $TMP crontab $TMP diff --git a/util/bin/magic b/util/bin/magic index cb9cee6e..a404c0c3 100755 --- a/util/bin/magic +++ b/util/bin/magic @@ -1,12 +1,8 @@ #! /bin/sh -# -# magic NAME create FILE < CONTENT -# magic NAME update FILE < CONTENT -# magic NAME destroy FILE -# +set -euf -bs="# begin krebs magic <$1>" -es="# end krebs magic <$1>" +bs="# begin krebs magic <$2>" +es="# end krebs magic <$2>" has() { grep -q "^$bs$" $3 && grep -q "^$es$" $3 @@ -37,7 +33,7 @@ destroy() { } help() { cat < Date: Tue, 8 Nov 2011 17:13:55 -0500 Subject: //noise/Makefile: add sudo powers for streams --- noise/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/noise/Makefile b/noise/Makefile index 932c5940..0d72b2e9 100644 --- a/noise/Makefile +++ b/noise/Makefile @@ -7,6 +7,7 @@ infest: apt-get install --yes expect beep alsa-utils ucspi-tcp espeak f=/usr/bin/beep; chown krebs:krebs $$f && chmod 4755 $$f getent passwd noise || useradd noise + echo 'noise ALL=(ALL) NOPASSWD: /krebs/streams/streams' | magic create noise /etc/sudoers ln -vsnf /krebs/noise/init.d/noise /etc/init.d/noise ## tv: TODO update-rc.d is DEBIAN ONLY, fix this update-rc.d -f noise defaults @@ -14,3 +15,4 @@ infest: amixer sset 'PCM' 100 unmute || true amixer sset 'PC Speaker' 100 unmute || \ amixer sset 'Beep' 100 unmute || true + -- cgit v1.2.3