File: restoremode.sh

package info (click to toggle)
fakechroot 2.9-1.1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,316 kB
  • ctags: 408
  • sloc: sh: 10,537; ansic: 2,223; perl: 126; makefile: 40
file content (10 lines) | stat: -rwxr-xr-x 267 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh
if [ "$(find ~ -maxdepth 0 -printf '%U\n')" != 0 ]; then
    echo "Use in fakechroot environment"
    exit 1
fi
tar zxf savemode.dat1 --numeric-owner
zcat savemode.dat2 | while read uid gid mode file; do
    chown $uid:$gid $file
    chmod $mode $file
done