From: Arvin Schnell Date: Tue, 19 Sep 2023 08:16:47 +0000 (+0200) Subject: - use snapper to change config instead of sed X-Git-Tag: v0.10.7~13^2~1 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=4e71aae00f7adc5cc0f34720056417372c4aa0d5;p=thirdparty%2Fsnapper.git - use snapper to change config instead of sed --- diff --git a/scripts/pam_snapper_homeconvert.sh b/scripts/pam_snapper_homeconvert.sh index ab76e35e..852a5176 100755 --- a/scripts/pam_snapper_homeconvert.sh +++ b/scripts/pam_snapper_homeconvert.sh @@ -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 } diff --git a/scripts/pam_snapper_pamconfig.sh b/scripts/pam_snapper_pamconfig.sh index 385c5614..6383a433 100755 --- a/scripts/pam_snapper_pamconfig.sh +++ b/scripts/pam_snapper_pamconfig.sh @@ -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" diff --git a/scripts/pam_snapper_useradd.sh b/scripts/pam_snapper_useradd.sh index 6ff50742..bc9d82e1 100755 --- a/scripts/pam_snapper_useradd.sh +++ b/scripts/pam_snapper_useradd.sh @@ -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 diff --git a/scripts/pam_snapper_userdel.sh b/scripts/pam_snapper_userdel.sh index 30be9beb..41bdbfbd 100755 --- a/scripts/pam_snapper_userdel.sh +++ b/scripts/pam_snapper_userdel.sh @@ -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"