]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- use snapper to change config instead of sed
authorArvin Schnell <aschnell@suse.de>
Tue, 19 Sep 2023 08:16:47 +0000 (10:16 +0200)
committerArvin Schnell <aschnell@suse.de>
Tue, 19 Sep 2023 08:16:47 +0000 (10:16 +0200)
scripts/pam_snapper_homeconvert.sh
scripts/pam_snapper_pamconfig.sh
scripts/pam_snapper_useradd.sh
scripts/pam_snapper_userdel.sh

index ab76e35e88d44f33692686e0d326cfb236fddaa1..852a5176ba1f5d96312a783a434ce8e1982a6b27 100755 (executable)
@@ -13,7 +13,6 @@ CMD_BTRFS="/sbin/btrfs"
 CMD_SNAPPER="/usr/bin/snapper"
 CMD_EGREP="grep -E"
 CMD_PAM_CONFIG="/usr/sbin/pam-config"
-CMD_SED="sed"
 CMD_USERADD="useradd -m"
 CMD_USERDEL="userdel -r"
 CMD_CHOWN="chown"
@@ -137,7 +136,7 @@ function createsnapperconfig () {
                fi
                echo "Create snapper configuration for user ${MYUSER}"
                ${CMD_SNAPPER} -c home_${MYUSER} create-config ${HOMEHOME}/${MYUSER}
-               ${CMD_SED} -i -e "s/ALLOW_USERS=\"\"/ALLOW_USERS=\"${MYUSER}\"/g" ${SNAPPERCFGDIR}/home_${MYUSER}
+               ${CMD_SNAPPER} -c home_${MYUSER} set-config ALLOW_USERS=${MYUSER}
        fi
        ${CMD_CHMOD} 755 ${HOMEHOME}/${MYUSER}/.snapshots
 }
index 385c56147c39225ea5e3f7bf4d38d67602293785..6383a43324d481d5c5c5cf5af1be32d388ac4c12 100755 (executable)
@@ -13,7 +13,6 @@ CMD_BTRFS="/sbin/btrfs"
 CMD_SNAPPER="/usr/bin/snapper"
 CMD_EGREP="grep -E"
 CMD_PAM_CONFIG="/usr/sbin/pam-config"
-CMD_SED="sed"
 CMD_USERADD="useradd -m"
 CMD_USERDEL="userdel -r"
 CMD_CHOWN="chown"
index 6ff50742db38b05addb5c4581e8039b4277dff4c..bc9d82e1f4bbfa3959a25ec3c8ed55ffb44c5ead 100755 (executable)
@@ -13,7 +13,6 @@ CMD_BTRFS="/sbin/btrfs"
 CMD_SNAPPER="/usr/bin/snapper"
 CMD_EGREP="grep -E"
 CMD_PAM_CONFIG="/usr/sbin/pam-config"
-CMD_SED="sed"
 CMD_USERADD="useradd"
 CMD_USERDEL="userdel -r"
 CMD_CHOWN="chown"
@@ -47,7 +46,7 @@ if [ ${DRYRUN} == 0 ] ; then
        ${CMD_BTRFS} subvol create ${HOMEHOME}/${MYUSER}
        # Create snapper config for USER
        ${CMD_SNAPPER} -c home_${MYUSER} create-config ${HOMEHOME}/${MYUSER}
-       ${CMD_SED} -i -e "s/ALLOW_USERS=\"\"/ALLOW_USERS=\"${MYUSER}\"/g" ${SNAPPERCFGDIR}/home_${MYUSER}
+       ${CMD_SNAPPER} -c home_${MYUSER} set-config ALLOW_USERS=${MYUSER}
        # Create USER
        ${CMD_USERADD} ${MYUSER}
        # Give USER skeleton files
index 30be9beb6a15cc0d8384e388620badb9f5a42517..41bdbfbda23edb296e3eb7b73eac63a956ebeb84 100755 (executable)
@@ -13,7 +13,6 @@ CMD_BTRFS="/sbin/btrfs"
 CMD_SNAPPER="/usr/bin/snapper"
 CMD_EGREP="grep -E"
 CMD_PAM_CONFIG="/usr/sbin/pam-config"
-CMD_SED="sed"
 CMD_USERADD="useradd -m"
 CMD_USERDEL="userdel -r"
 CMD_CHOWN="chown"