Make passwd parsing more generic to improve compatibility

This commit is contained in:
Janek Bevendorff 2014-10-05 16:35:45 +02:00
parent 33f85d5d93
commit b719226c73
1 changed files with 1 additions and 2 deletions

View File

@ -34,5 +34,4 @@ if [ "${BACKUP_ROOT}" == "" ] || [ "$(realpath ${BACKUP_ROOT})" == "/" ]; then
exit 1
fi
touch "${BACKUP_ROOT}/etc/passwd"
cat /etc/passwd | grep "::${BACKUP_ROOT}/[^/:]\+:/bin/[^:]\+$" > "${BACKUP_ROOT}/etc/passwd"
grep ":rs-backup user:${BACKUP_ROOT}/[^:]\+:[^:]\+$" /etc/passwd > "${BACKUP_ROOT}/etc/passwd"