added missing formating in stat -c

This commit is contained in:
Jonas Forsberg 2020-10-14 10:43:37 +02:00
parent 822eccbe31
commit 70b3bea10d
No known key found for this signature in database
GPG Key ID: F2E9818C70350CC9

View File

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
[[ ! -f "$HOME/.borgbackup.env" ]] && printf "\$HOME/.borgbackup.env doesn't exist!\n" && exit 1 [[ ! -f "$HOME"/.borgbackup.env ]] && printf "\$HOME/.borgbackup.env doesn't exist!\n" && exit 1
if [[ "$(stat -c "$HOME/.borgbackup.env")" != "-rw-------" ]]; then if [[ "$(stat -c %A "$HOME"/.borgbackup.env)" != "-rw-------" ]]; then
printf "WARNING!!!! \$HOME/.borgbackup.env has the wrong permissions!\n" printf "WARNING!!!! \$HOME/.borgbackup.env has the wrong permissions!\n"
printf "\nrun : chmod 0600 \$HOME/.borgbackup.env\n" printf "\nrun : chmod 0600 \$HOME/.borgbackup.env\n"
exit 1 exit 1