Make sure passwd file exists before writing to it

This commit is contained in:
Janek Bevendorff 2013-11-20 14:43:30 +01:00
parent fcbb1ddecd
commit 7d91290118
1 changed files with 1 additions and 0 deletions

View File

@ -8,4 +8,5 @@ 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"