summaryrefslogtreecommitdiffstats
path: root/build/install/uninstall.sh
diff options
context:
space:
mode:
authorJonas Bjurel <jonas.bjurel@ericsson.com>2015-11-25 11:32:57 +0100
committerJonas Bjurel <jonas.bjurel@ericsson.com>2015-11-27 10:24:23 +0100
commit24a95306d2564b272b5320e9149d9aea70b4061c (patch)
tree8c1a2c9f7acbfed41f8ebc56a8ae1f7d316f7cff /build/install/uninstall.sh
parent7077376d6e0ff0dec77080fa21b75911b811475d (diff)
Restructcture of the directory layout
Restructure of the directory layout due to move of Fuel into it's own repo JIRA: FUEL-85 Change-Id: I3647e1992a508f29dce06a5d6c790725c527f6f5 Signed-off-by: Jonas Bjurel <jonas.bjurel@ericsson.com>
Diffstat (limited to 'build/install/uninstall.sh')
-rwxr-xr-xbuild/install/uninstall.sh79
1 files changed, 79 insertions, 0 deletions
diff --git a/build/install/uninstall.sh b/build/install/uninstall.sh
new file mode 100755
index 000000000..a9e74bc39
--- /dev/null
+++ b/build/install/uninstall.sh
@@ -0,0 +1,79 @@
+#!/bin/bash -e
+##############################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+# stefan.k.berg@ericsson.com
+# jonas.bjurel@ericsson.com
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+
+my_exit() {
+ cd /tmp
+ if [ -d "$MOUNT" ]; then
+ fusermount -u $MOUNT
+ rmdir $MOUNT
+ fi
+}
+trap my_exit EXIT
+
+echo "Live uninstall is currently disabled as it is not tested"
+exit 1
+
+TOP=`pwd`
+MOUNT=`mktemp -d /tmp/XXXXXXX`
+ssh-copy-id root@10.20.0.2
+sshfs root@10.20.0.2:/ $MOUNT
+
+DEST=$MOUNT
+REPO=$DEST/var/www/nailgun/ubuntu/fuelweb/x86_64
+
+cd $REPO
+if [ ! -f $REPO/dists/trusty/main/binary-amd64/Packages.backup ]; then
+ echo "Error - didn't find backup file for Packages!"
+ exit 1
+fi
+
+if [ ! -f $REPO/dists/trusty/main/binary-amd64/Packages.gz.backup ]; then
+ echo "Error - didn't find backup file for Packages.gz!"
+ exit 1
+fi
+
+if [ ! -f $REPO/dists/trusty/Release.backup ]; then
+ echo "Error - didn't find backup file for Release!"
+ exit 1
+fi
+
+if [ ! -f $DEST/etc/puppet/manifests/site.pp.backup ]; then
+ echo "Error - didn't find backup file for site.pp!"
+ exit 1
+fi
+
+echo "Removing Debian packages:"
+cd $TOP/release/pool/main
+for deb in *.deb
+do
+ echo " $deb"
+ rm -Rf $REPO/pool/main/$deb
+done
+cd $REPO
+
+echo "Removing Puppet modules:"
+cd $TOP/puppet/modules
+for dir in *
+do
+ echo " $dir"
+ rm -Rf $DEST/etc/puppet/modules/$dir
+done
+cd $REPO
+
+echo "Restoring backups of datafiles"
+
+rm -f $REPO/dists/trusty/main/binary-amd64/Packages $REPO/dists/trusty/main/binary-amd64/Packages.gz
+rm -f $REPO/dists/trusty/Release $DEST/etc/puppet/manifests/site.pp
+mv $REPO/dists/trusty/main/binary-amd64/Packages.backup $REPO/dists/trusty/main/binary-amd64/Packages
+mv $REPO/dists/trusty/main/binary-amd64/Packages.gz.backup $REPO/dists/trusty/main/binary-amd64/Packages.gz
+mv $REPO/dists/trusty/Release.backup $REPO/dists/trusty/Release
+mv $DEST/etc/puppet/manifests/site.pp.backup $DEST/etc/puppet/manifests/site.pp