]> arthur.barton.de Git - ax-linux.git/blobdiff - btrfs/mksnapshot/btrfs-mksnapshot-rootfs
btrfs-mksnapshot[-rootfs]: Fix shellcheck(1) warnings
[ax-linux.git] / btrfs / mksnapshot / btrfs-mksnapshot-rootfs
index ebc2f3f42910a0a979e854aeab25de402ed91476..2744d03727e2bffe3e757a796f05348dd36d2265 100755 (executable)
@@ -1,7 +1,7 @@
-#!/bin/bash -e
+#!/bin/sh -e
 #
 # btrfs-mksnapshot-rootfs -- Make snapshots of root filesystems ("/")
-# Copyright (c)2014 Alexander Barton (alex@barton.de)
+# Copyright (c)2014-2020 Alexander Barton (alex@barton.de)
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -9,9 +9,9 @@
 # (at your option) any later version.
 #
 
-NAME=`basename "$0"`
+NAME=$(basename "$0")
 
-function Usage()
+Usage()
 {
        echo "Usage: $NAME"; echo
        exit 1
@@ -19,7 +19,7 @@ function Usage()
 
 [ $# -eq 0 ] || Usage
 
-if [ -n "`fgrep ' / btrfs ' /etc/fstab 2>/dev/null`" ]; then
+if grep -Fq ' / btrfs ' /etc/fstab; then
        if [ -x /usr/local/sbin/btrfs-mksnapshot ]; then
                /usr/local/sbin/btrfs-mksnapshot -1 / || exit 1
        else