From 6cee1e09b17453f987abc33215462cf0d01c690b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 15 Oct 2021 13:27:38 +0200 Subject: Minor script improvements --- upload-machine | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'upload-machine') diff --git a/upload-machine b/upload-machine index 8d6e730..5d4e6b7 100755 --- a/upload-machine +++ b/upload-machine @@ -86,20 +86,19 @@ oldsv_host="$machines/$mname/$oldsv_name" # Make sure subvolumes are read-only. # -function check_ro () # +function make_ro () # { local r; r="$(btrfs property get -ts "$1" ro)" if [ "$r" != "ro=true" ]; then - info "subvolume '$1' is not read-only; to change, run:" - info " btrfs property set -ts $1 ro true" - exit 1 + info "subvolume '$1' is read-write, changing to read-only" + btrfs property set -ts "$1" ro true fi } -check_ro "$newsv" +make_ro "$newsv" if [ -n "$oldsv" ]; then - check_ro "$oldsv" + make_ro "$oldsv" fi # btrfs send command -- cgit v1.1