Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
Ragnar/scripts/uninstall_kiosk.sh at main · PierreGode/Ragnar · GitHub
Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
PierreGode
Ragnar
Repository navigation
Code
Issues
1
(1)
Pull requests
2
(2)
Discussions
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
Ragnar
/
scripts
/
uninstall_kiosk.sh
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
executable file
·
69 lines (58 loc) · 2.75 KB
main
Breadcrumbs
Ragnar
/
scripts
/
uninstall_kiosk.sh
Copy path
Top
File metadata and controls
Code
Blame
executable file
·
69 lines (58 loc) · 2.75 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!
/bin/bash
#
Ragnar on-screen kiosk uninstaller.
#
Removes the systemd unit (service mode) and/or the XDG autostart entry
#
(autostart mode) for every regular user. Also drops the wrapper and tty1
#
autologin drop-in. Apt packages are left in place unless --purge is given.
set
-euo pipefail
SERVICE_FILE=
"
/etc/systemd/system/ragnar-kiosk.service
"
WRAPPER_DST=
"
/usr/local/bin/ragnar-kiosk-run
"
AUTOLOGIN_DROPIN=
"
/etc/systemd/system/getty@tty1.service.d/autologin.conf
"
AUTOSTART_REL=
"
.config/autostart/ragnar-kiosk.desktop
"
PURGE=0
for
arg
in
"
$@
"
;
do
case
"
$arg
"
in
--purge) PURGE=1 ;;
esac
done
#
Systemd unit (service mode)
if
systemctl list-unit-files
2>
/dev/null
|
grep -q
'
^ragnar-kiosk\.service
'
;
then
systemctl disable --now ragnar-kiosk.service
2>
/dev/null
||
true
fi
rm -f
"
$SERVICE_FILE
"
rm -f
"
$WRAPPER_DST
"
rm -f
"
$AUTOLOGIN_DROPIN
"
rm -f /etc/sudoers.d/ragnar-kiosk
if
[[
-d
"
$(
dirname
"
$AUTOLOGIN_DROPIN
"
)
"
]]
;
then
rmdir --ignore-fail-on-non-empty
"
$(
dirname
"
$AUTOLOGIN_DROPIN
"
)
"
||
true
fi
#
Try to kill any running kiosk chromium (autostart mode users) + the escape-hatch
#
button/hotkey we may have launched alongside it.
pkill -f
'
ragnar-kiosk-chromium
'
2>
/dev/null
||
true
pkill -f
'
ragnar_kiosk_exit_button\.py
'
2>
/dev/null
||
true
pkill -f
'
ragnar-kiosk-xbk
'
2>
/dev/null
||
true
#
Autostart entries — scan every regular user's home for the .desktop file.
getent passwd
|
awk -F:
'
$3 >= 1000 && $3 < 65534 {print $6}
'
|
while
read
-r home
;
do
if
[[
-n
"
$home
"
&&
-f
"
$home
/
$AUTOSTART_REL
"
]]
;
then
rm -f
"
$home
/
$AUTOSTART_REL
"
echo
"
[kiosk-uninstall] removed autostart entry for
$home
"
fi
done
systemctl daemon-reload
||
true
#
Restore the physical console. The kiosk ran Xorg on tty7 and switched the
#
active VT there; tearing it down leaves the display on that now-dead VT (a
#
black screen) with no way back to the CLI. Worse, some Ragnar OS images ship
#
getty@tty1 masked/disabled so ONLY the kiosk draws the screen — then even a
#
reboot comes up black. So make sure a real login console exists on tty1 and
#
switch the display back to it. All steps are no-ops on a box that was already
#
fine (tty1 getty is enabled by default), so this is safe to always run.
systemctl unmask getty@tty1.service
2>
/dev/null
||
true
systemctl
enable
getty@tty1.service
2>
/dev/null
||
true
systemctl restart getty@tty1.service
2>
/dev/null
||
true
command
-v chvt
>
/dev/null
2>&1
&&
chvt 1
2>
/dev/null
||
true
echo
"
[kiosk-uninstall] console restored on tty1
"
if
[[
"
$PURGE
"
-eq
1 ]]
;
then
DEBIAN_FRONTEND=noninteractive apt-get remove -y --purge \
chromium-browser xserver-xorg xinit x11-xserver-utils openbox unclutter xauth
||
true
DEBIAN_FRONTEND=noninteractive apt-get autoremove -y
||
true
fi
echo
"
[kiosk-uninstall] done
"
You can’t perform that action at this time.