File: restoremode.sh

package info (click to toggle)
fakechroot 2.20.1%2Bds-18
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,904 kB
  • sloc: ansic: 7,688; sh: 1,917; makefile: 375; perl: 191; java: 5
file content (11 lines) | stat: -rwxr-xr-x 247 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh

# This script restores uids and gids of files saved previously
# with savemode.sh script

tar zxf savemode.dat1 --numeric-owner

zcat savemode.dat2 | while read uid gid mode file; do
    chown $uid:$gid $file
    chmod $mode $file
done