#!/bin/sh # remove private changes of a file if [ -z "$1" ]; then echo "Usage: $0 FILE..." exit 1 fi exec rm $( while [ $# -gt 0 ]; do if [ -z "${1##-*}" ]; then # Optionen an rm durchreichen echo -n " $1" else path=$1 if [ -n "${path##/*}" ]; then path=$(pwd)/$path fi if [ -e /mnt/system$path ]; then echo " /mnt/system$path" elif [ -e /mnt/rootfs$path ]; then echo " /mnt/rootfs$path" elif [ -e /mnt/rootimg$path ]; then echo " /mnt/rootimg$path" else # nachgelöschten Dateien suchen path="${path%/*}/.wh.${path##*/}" if [ -e /mnt/system$path ]; then echo " /mnt/system$path" elif [ -e /mnt/rootfs$path ]; then echo " /mnt/rootfs$path" elif [ -e /mnt/rootimg$path ]; then echo " /mnt/rootimg$path" else echo "File not found '$1' $path" >&2 fi fi fi shift done )