~andrewjbeach/juju-ci-tools/make-local-patcher

« back to all changes in this revision

Viewing changes to remove-manual-juju.bash

  • Committer: Aaron Bentley
  • Date: 2015-09-02 17:46:47 UTC
  • mto: This revision was merged to the branch mainline in revision 1082.
  • Revision ID: aaron.bentley@canonical.com-20150902174647-06vmnsooo6yzd46t
Stop supplying env to subprocess calls.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/bash
2
2
 
 
3
JUJU_DIR="/var/lib/juju"
 
4
DUMMY_DIR="/var/run/dummy-sink"
3
5
ips="$@"
4
6
for ip in $ips; do
5
 
    ssh -i $JUJU_HOME/staging-juju-rsa ubuntu@$ip <<"EOT"
 
7
    ssh -i $JUJU_HOME/staging-juju-rsa ubuntu@$ip <<EOT
6
8
#!/bin/bash
7
9
set -ux
8
 
 
9
 
echo "Cleaning manual machine"
10
 
 
11
 
JUJU_DIR="/var/lib/juju"
12
 
DUMMY_DIR="/var/run/dummy-sink"
13
 
if ps -f -C jujud; then
14
 
    sudo touch $JUJU_DIR/uninstall-agent
 
10
if [[ -n "$(ps ax | grep jujud | grep -v grep)" ]]; then
15
11
    sudo killall -SIGABRT jujud
 
12
    sudo killall -9 mongod
16
13
fi
17
 
sudo killall -9 mongod || true
18
14
if [[ -d $JUJU_DIR ]]; then
19
15
    sudo rm -r $JUJU_DIR
20
16
fi
21
17
if [[ -d $DUMMY_DIR ]]; then
22
18
    sudo rm -r $DUMMY_DIR
23
19
fi
24
 
sudo find /etc/init -name 'juju*' -delete || true
25
 
echo "Cleaning completed"
26
 
exit 0
 
20
sudo find /etc/init -name 'juju*' -delete
27
21
EOT
28
22
done