~adeuring/jujuredirector/redirect-script-connection-errors

« back to all changes in this revision

Viewing changes to setup-juju.sh

  • Committer: Ben Howard
  • Date: 2014-04-22 15:07:36 UTC
  • Revision ID: ben.howard@ubuntu.com-20140422150736-82eavqcjln2biiwq
Switch who runs the commands

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
legacy_juju=0
8
8
(dpkg-query -s juju-local >> /dev/null ) || legacy_juju=1
9
9
 
10
 
_juju() {
11
 
    # With Juju 1.18, juju-local appeared, and it doesn't like
12
 
    # to be run as root
 
10
_run_cmd() {
13
11
    [ "${legacy_juju}" -eq 0 ] &&
14
12
        su vagrant -c "juju ${@}" ||
15
 
        juju ${@}
 
13
       " ${@}"
 
14
}
 
15
 
 
16
_juju() {
 
17
    _run_cmd juju "${@}"
16
18
}
17
19
 
18
20
my_dir=$(dirname ${0})
54
56
) >> /var/log/juju-setup.log
55
57
 
56
58
_juju "expose juju-gui"
57
 
python /root/redirect.py
 
59
_run_cmd python /root/redirect.py
58
60
_juju set juju-gui secure='false'
59
61
 
60
62
# Start it all up