forked from Vanilla-OS/first-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
__first_setup_cleanup
executable file
·25 lines (21 loc) · 1022 Bytes
/
__first_setup_cleanup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
if [ "$USER" != 'vanilla' ]; then
# the vanilla user is not needed anymore and must be removed to avoid
# leaving a high privileged user in the system which could be used as
# a backdoor to perform privilege escalation attacks
userdel -r vanilla
fi
if [ -e '/var/lib/AccountsService/users/vanilla' ]; then
# the vanilla's AccountsService entry is removed to allow the user
# creating a new user with the same name without those rules
rm /var/lib/AccountsService/users/vanilla
fi
if [ -e '/etc/xdg/autostart/org.vanillaos.FirstSetup.nextBoot.desktop' ]; then
# the nextBoot desktop entry is not needed anymore, the application will recreate it
# for new users if they complete the first setup
rm /etc/xdg/autostart/org.vanillaos.FirstSetup.nextBoot.desktop
fi
if [ -e '/etc/org.vanillaos.FirstSetup.nextBoot' ]; then
# we preserve the file for new users, to avoid creating policies to allow them to create it
echo '' > /etc/org.vanillaos.FirstSetup.nextBoot
fi