Take into account renaming to Tails in some more places.
[tails-test.git] / config / chroot_local-includes / etc / init.d / tails-kexec
blobce51678fde9249c4249d70dc7da546af78376bdf
1 #! /bin/sh
2 ### BEGIN INIT INFO
3 # Provides: tails-kexec
4 # Required-Start:
5 # Required-Stop:
6 # Should-Stop: halt reboot
7 # X-Stop-After: umountroot live-boot
8 # Default-Start:
9 # Default-Stop: 0 6
10 # X-Interactive: true
11 # Short-Description: Execute the kexec -e command to reboot system
12 # Description:
13 ### END INIT INFO
15 # FIXME: this script should be translatable in a better way than the
16 # ugly case..esac thing. Note that using gettext at this point -i.e.
17 # after the CD has been ejected- is probably too brittle. A possible
18 # solution would be to turn this script into a .in file, with
19 # placeholders for translatable string. Translatable strings and their
20 # translations could be managed by ikiwiki+po, and the placeholders
21 # could be replaced at boot time -depending on the chosen locale- by
22 # the appropriate strings. Unfortunately po4a does not support shell
23 # scripts.
25 PATH=/sbin:/bin
27 print_text () {
28 echo "$1" > /dev/console
31 print_empty_line () {
32 print_text ''
35 do_stop () {
36 test "x`/bin/cat /sys/kernel/kexec_loaded`y" = "x1y" || exit 0
38 /bin/stty sane < /dev/console
40 print_empty_line
41 print_empty_line
42 print_text "--------------------------------------------------------------------------------"
44 # $LANG was set there by the FIXME live-config upstream script
45 . /etc/default/locale
47 # Note to translators: any text line must fit on a 80 characters wide screen
48 case "${LANG}" in
49 es_ES.UTF-8)
50 print_text " Puede ahora retirar el CD o el USB de arranque."
51 print_empty_line
52 print_text " Se borrará dentro de pocos segundos la memoria RAM del sistema..."
53 print_empty_line
54 print_text "Pueden aparecer problemas de visualización en el monitor durante esta operación."
56 fr_FR.UTF-8)
57 print_text " Vous pouvez maintenant retirer le CD / clé USB de boot."
58 print_empty_line
59 print_text " La mémoire vive va être effacée dans quelques secondes..."
60 print_empty_line
61 print_text " Il est possible que l'affichage soit corrompu au cours de cette opération."
64 print_text " You can now remove the boot CD or USB stick."
65 print_empty_line
66 print_text " The system memory is going to be wiped in a few seconds..."
67 print_empty_line
68 print_text " Display might be corrupted during this operation."
70 esac
72 print_text "--------------------------------------------------------------------------------"
73 print_empty_line
74 print_empty_line
76 /bin/sleep 5
77 /sbin/kexec -e
80 case "$1" in
81 start)
82 # No-op
84 restart|reload|force-reload)
85 echo "Error: argument '$1' not supported" >&2
86 exit 3
88 stop)
89 do_stop
92 echo "Usage: $0 start|stop" >&2
93 exit 3
95 esac
96 exit 0