obosdi-pkg/install/system/services/numlockon
2015-08-20 22:37:06 +02:00

18 lines
482 B
Bash

#!/bin/bash
. ./lib
if (confirm "numlockon is a custom service created by this script.\nIt call ""setleds -D +num"" on tty1 to tty6.\n\nCreate /etc/systemd/system/numlockon.service ?") then
cat > /etc/systemd/system/numlockon.service << "EOF"
[Unit]
Description=Switch on numlock from tty1 to tty6
[Service]
ExecStart=/bin/bash -c 'for tty in /dev/tty{1..6};do /usr/bin/setleds -D +num < \"$tty\";done'
[Install]
WantedBy=multi-user.target
EOF
svcenable numlockon
fi
exit 0