Skip to content

Commit

Permalink
Make compatible with new firstboot script
Browse files Browse the repository at this point in the history
Check if systemd is running before appropriate systemctl commands

Simplify deluser.desktop
  • Loading branch information
XECDesign committed Sep 1, 2022
1 parent 9ee653e commit c2892a5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
16 changes: 11 additions & 5 deletions cancel-rename
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

INIT="$(ps --no-headers -o comm 1)"

if [ "$(id -u)" != "0" ]; then
echo "Please run with 'sudo': sudo cancel-rename USER" >&2
exit 1
Expand All @@ -26,7 +28,7 @@ if [ "$(raspi-config nonint get_boot_cli)" -ne 0 ]; then
Type=Application
Name=Delete Wizard User
NoDisplay=true
Exec=sh -c 'sudo userdel -r rpi-first-boot-wizard; sudo rm /etc/sudoers.d/010_wiz-nopasswd; sudo rm /etc/xdg/autostart/deluser.desktop'
Exec=sudo sh -c 'userdel -r rpi-first-boot-wizard; rm -f /etc/sudoers.d/010_wiz-nopasswd /etc/xdg/autostart/deluser.desktop'
EOF
else
if [ -f /var/lib/userconf-pi/autologin ]; then
Expand All @@ -38,9 +40,13 @@ fi

rm -f /var/lib/userconf-pi/autologin
rm -f /etc/ssh/sshd_config.d/rename_user.conf
if systemctl --quiet is-active ssh; then
systemctl --quiet reload ssh
fi

systemctl --quiet disable userconfig
systemctl --quiet enable getty@tty1 --now --no-block
systemctl --quiet enable getty@tty1

if [ "$INIT" = "systemd" ]; then
if systemctl --quiet is-active ssh; then
systemctl --quiet reload ssh
fi
systemctl --quiet --no-block start getty@tty1
fi
3 changes: 3 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ userconf-pi (0.5) bullseye; urgency=medium

* Add WIZ_USER to video group
- Required for vcgencmd commands
* Simplify deluser.desktop
* Check if systemd is running before appropriate systemctl commands
- Allows the new firstboot script to work

-- Serge Schneider <serge@raspberrypi.com> Wed, 17 Aug 2022 13:50:07 +0100

Expand Down

0 comments on commit c2892a5

Please sign in to comment.