From 3568798dd45d6f2f03b90e821330fe98f2d831f8 Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Mon, 22 Jan 2018 03:41:45 +0000 Subject: [PATCH] Give the new file the same ownership as the old file (instead of having it always owned just by root) --- pishrink.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pishrink.sh b/pishrink.sh index aebc4ee..cc5a671 100755 --- a/pishrink.sh +++ b/pishrink.sh @@ -45,6 +45,8 @@ if [ -n "$2" ]; then echo "ERROR: Could not copy file..." exit -5 fi + old_owner=$(stat -c %u:%g "$1") + chown $old_owner "$2" img="$2" fi