1
0
This repository has been archived on 2025-01-10. You can view files and clone it, but cannot push or open issues or pull requests.
alacn1_pace_v5471/permssave.sh
Anderson Luiz Alves c712f0be6e perms save and restore
2017-07-30 16:48:02 -03:00

33 lines
522 B
Bash
Executable File

#!/bin/bash
PERMSFILE=perms
echo "saving $PERMSFILE ..."
if [ -e "$PERMSFILE" ]
then
echo "WARNING: overwriting file: $PERMSFILE"
fi
set -o pipefail
# exclude /dev
# exclude .gitkeep
# perm modes
find squashfs-root \
-path squashfs-root/dev -prune \
-o \
! -name .gitkeep \
-exec stat -c '%A %n' {} \; | sort -t ' ' -k 2 > $PERMSFILE
RET=$?
if [ $RET != 0 ]
then
echo "ERROR: save perms failed"
exit 1
fi
echo 'done.'
exit 0