Skip to content

Commit

Permalink
Merge pull request #839 from aschnell/master
Browse files Browse the repository at this point in the history
tiny improvements to pam scripts
  • Loading branch information
aschnell authored Sep 19, 2023
2 parents 0641911 + 9b97a8b commit 1ce4369
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
3 changes: 1 addition & 2 deletions scripts/pam_snapper_homeconvert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
Expand Down
1 change: 0 additions & 1 deletion scripts/pam_snapper_pamconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 2 additions & 4 deletions scripts/pam_snapper_useradd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ 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_USERADD="useradd --no-create-home"
CMD_CHOWN="chown"
CMD_CHMOD="chmod"
CMD_CPA="cp -a"
Expand Down Expand Up @@ -47,7 +45,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
Expand Down
4 changes: 1 addition & 3 deletions scripts/pam_snapper_userdel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ 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_USERDEL="userdel --remove"
CMD_CHOWN="chown"
#
SNAPPERCFGDIR="/etc/snapper/configs"
Expand Down

0 comments on commit 1ce4369

Please sign in to comment.