Skip to content

Commit

Permalink
postinst scripts: avoid recursive chown of greetd.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
johnraff committed Dec 28, 2024
1 parent df9ea37 commit beeec9c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions debian/bunsen-configs-base.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set -e
DEFAULT_CURSOR_THEME='/usr/share/icons/DMZ-White/cursor.theme'
BUNSEN_SESSION='/usr/bin/bunsenlabs-session'
MAN1='/usr/share/man/man1'
GREETD="/etc/greetd"
GREETD="/etc/greetd/greetd.conf"

case $1 in
configure|abort-upgrade|abort-deconfigure|abort-remove)
Expand All @@ -36,9 +36,9 @@ configure|abort-upgrade|abort-deconfigure|abort-remove)
update-grub || true
fi
# fix ownership of some introduced files, allow showing graphical login with greetd
if [ -d "$GREETD" ] && id _greetd >/dev/null 2>&1
if [ -f "$GREETD" ] && id _greetd >/dev/null 2>&1
then
chown -R _greetd:_greetd "$GREETD"
chown _greetd:_greetd "$GREETD"
usermod -a -G video _greetd
fi
;;
Expand Down
6 changes: 3 additions & 3 deletions debian/bunsen-configs-lite.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set -e
DEFAULT_CURSOR_THEME='/usr/share/icons/DMZ-White/cursor.theme'
BUNSEN_SESSION='/usr/bin/bunsenlabs-session'
MAN1='/usr/share/man/man1'
GREETD="/etc/greetd"
GREETD="/etc/greetd/greetd.conf"

case $1 in
configure|abort-upgrade|abort-deconfigure|abort-remove)
Expand All @@ -36,9 +36,9 @@ configure|abort-upgrade|abort-deconfigure|abort-remove)
update-grub || true
fi
# fix ownership of some introduced files, allow showing graphical login with greetd
if [ -d "$GREETD" ] && id _greetd >/dev/null 2>&1
if [ -f "$GREETD" ] && id _greetd >/dev/null 2>&1
then
chown -R _greetd:_greetd "$GREETD"
chown _greetd:_greetd "$GREETD"
usermod -a -G video _greetd
fi
;;
Expand Down
6 changes: 3 additions & 3 deletions debian/bunsen-configs.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set -e
DEFAULT_CURSOR_THEME='/usr/share/icons/DMZ-White/cursor.theme'
BUNSEN_SESSION='/usr/bin/bunsenlabs-session'
MAN1='/usr/share/man/man1'
GREETD="/etc/greetd"
GREETD="/etc/greetd/greetd.conf"

case $1 in
configure|abort-upgrade|abort-deconfigure|abort-remove)
Expand All @@ -36,9 +36,9 @@ configure|abort-upgrade|abort-deconfigure|abort-remove)
update-grub || true
fi
# fix ownership of some introduced files, allow showing graphical login with greetd
if [ -d "$GREETD" ] && id _greetd >/dev/null 2>&1
if [ -f "$GREETD" ] && id _greetd >/dev/null 2>&1
then
chown -R _greetd:_greetd "$GREETD"
chown _greetd:_greetd "$GREETD"
usermod -a -G video _greetd
fi
;;
Expand Down

0 comments on commit beeec9c

Please sign in to comment.