obosdi-pkg/install/system/services/numlockon

19 lines
482 B
Text
Raw Normal View History

2015-08-20 14:37:06 -06:00
#!/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