2 ##############################################################################
3 # Copyright (c) 2015 Ericsson AB and others.
4 # stefan.k.berg@ericsson.com
5 # jonas.bjurel@ericsson.com
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
15 if [ -d "$MOUNT" ]; then
22 echo "Live uninstall is currently disabled as it is not tested"
26 MOUNT=`mktemp -d /tmp/XXXXXXX`
27 ssh-copy-id root@10.20.0.2
28 sshfs root@10.20.0.2:/ $MOUNT
31 REPO=$DEST/var/www/nailgun/ubuntu/fuelweb/x86_64
34 if [ ! -f $REPO/dists/precise/main/binary-amd64/Packages.backup ]; then
35 echo "Error - didn't find backup file for Packages!"
39 if [ ! -f $REPO/dists/precise/main/binary-amd64/Packages.gz.backup ]; then
40 echo "Error - didn't find backup file for Packages.gz!"
44 if [ ! -f $REPO/dists/precise/Release.backup ]; then
45 echo "Error - didn't find backup file for Release!"
49 if [ ! -f $DEST/etc/puppet/manifests/site.pp.backup ]; then
50 echo "Error - didn't find backup file for site.pp!"
54 echo "Removing Debian packages:"
55 cd $TOP/release/pool/main
59 rm -Rf $REPO/pool/main/$deb
63 echo "Removing Puppet modules:"
64 cd $TOP/puppet/modules
68 rm -Rf $DEST/etc/puppet/modules/$dir
72 echo "Restoring backups of datafiles"
74 rm -f $REPO/dists/precise/main/binary-amd64/Packages $REPO/dists/precise/main/binary-amd64/Packages.gz
75 rm -f $REPO/dists/precise/Release $DEST/etc/puppet/manifests/site.pp
76 mv $REPO/dists/precise/main/binary-amd64/Packages.backup $REPO/dists/precise/main/binary-amd64/Packages
77 mv $REPO/dists/precise/main/binary-amd64/Packages.gz.backup $REPO/dists/precise/main/binary-amd64/Packages.gz
78 mv $REPO/dists/precise/Release.backup $REPO/dists/precise/Release
79 mv $DEST/etc/puppet/manifests/site.pp.backup $DEST/etc/puppet/manifests/site.pp