diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2021-10-15 13:27:38 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2021-10-15 13:27:38 +0200 |
commit | 6cee1e09b17453f987abc33215462cf0d01c690b (patch) | |
tree | 74b5ba0c6d643e2af7701edd8de8f73d47d4d9ae /upload-machine | |
parent | 18e8736a93b252465ca537e978c5b0b8a3219751 (diff) |
Minor script improvements
Diffstat (limited to 'upload-machine')
-rwxr-xr-x | upload-machine | 11 |
1 files changed, 5 insertions, 6 deletions
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 () # <subvol> +function make_ro () # <subvol> { 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 |