1. VectorLinux Core
  2. vlbuildbot

Commits

M0E-lnx  committed d4bf511

Add reset-chroot script for quick chroot cleaning

  • Participants
  • Parent commits 7bb1acf
  • Branches master

Comments (0)

Files changed (1)

File slave/usr/local/bin/reset-chroot

View file
  • Ignore whitespace
+#!/bin/bash
+function reset() {
+DIR=$1
+( cd $DIR || exit 1
+ for i in *; do
+	 case $i in
+		 home|root)
+			 continue
+			 ;;
+		 *)
+			 #echo "remove $i"
+			 rm -rf $i
+			 ;;
+		esac
+	done
+	)
+}
+case $1 in
+	"")
+		echo "Usage: $@ CHROOT-RW[N]"
+		exit 0
+		;;
+	*)
+		reset $1
+		;;
+esac
+