summaryrefslogtreecommitdiff
path: root/support/truncate_repositories.sh
diff options
context:
space:
mode:
Diffstat (limited to 'support/truncate_repositories.sh')
-rwxr-xr-xsupport/truncate_repositories.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/support/truncate_repositories.sh b/support/truncate_repositories.sh
new file mode 100755
index 0000000..3b14e2e
--- /dev/null
+++ b/support/truncate_repositories.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+echo "Danger!!! Data Loss"
+while true; do
+ read -p "Do you wish to all directories except gitolite-admin.git from /home/git/repositories/ (y/n) ?: " yn
+ case $yn in
+ [Yy]* ) sh -c "find /home/git/repositories/. -maxdepth 1 -not -name 'gitolite-admin.git' -not -name '.' | xargs sudo rm -rf"; break;;
+ [Nn]* ) exit;;
+ * ) echo "Please answer yes or no.";;
+ esac
+done