Ignore:
Timestamp:
Nov 25, 2008, 8:16:34 AM (16 years ago)
Author:
broder
Message:

Fix invirt-dev to not add the same line a bunch of times to sudoers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-dev/debian/invirt-dev.postinst

    • Property svn:executable set to *
    r1329 r1770  
    99            adduser --system repository
    1010            addgroup --system repo
    11             echo "%repo   ALL=(repository)        ALWAYS_SET_HOME,NOPASSWD: /usr/bin/reprepro" >>/etc/sudoers
     11           
     12            # Clean up the old sudoers block, then add it back
     13            perl -i.bak -ne 's%^### (BEGIN|END) invirt-dev\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers
     14           
     15            cat >>/etc/sudoers <<EOF
     16### BEGIN invirt-dev
     17%repo   ALL=(repository)        ALWAYS_SET_HOME,NOPASSWD: /usr/bin/reprepro
     18### END invirt-dev
     19EOF
    1220            echo "-----"
    1321            echo "invirt-dev: run"
Note: See TracChangeset for help on using the changeset viewer.