Ubuntu Pastebin

Paste from ubuntu at Wed, 6 Apr 2016 14:44:52 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
set -ex

# Run $1 as a normal user. This isn't currently quoted properly, but it does
# run the command in a login shell, which I think is as close as I can get and
# all I need right now. It also preserves the current working directory so that
# dep8 test resources can still be located. There was some discussion of this
# approach at: http://irclogs.ubuntu.com/2014/06/06/%23ubuntu-devel.html#t09:35

# Author: Robie Basak <robie.basak@canonical.com>

adduser --disabled-password --gecos '' jujutest

# Allow jujutest to sudo back to root (this is what juju expects)
echo 'jujutest ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/jujutest

sudo -iu jujutest sh <<EOT
cd "$PWD"
$@
EOT
Download as text