X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=usr_bin%2Fcaps-ctrl;h=dfaec760c76ce176b1edc4cb78c0b6a9292311dc;hb=6ef5cf49df61ad6a7ab5fde12598f2394f6a4fb2;hp=e597c90e210093f161644e700dcf88c570e16677;hpb=e1a324809d64170021b4a9e236972375a329ac46;p=grml-scripts.git diff --git a/usr_bin/caps-ctrl b/usr_bin/caps-ctrl index e597c90..dfaec76 100755 --- a/usr_bin/caps-ctrl +++ b/usr_bin/caps-ctrl @@ -4,7 +4,6 @@ # Authors: grml-team (grml.org), (c) Matthias Kopfermann # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Don Nov 23 22:32:29 CET 2006 [mika] ################################################################################ if . /etc/grml/script-functions ; then @@ -13,12 +12,11 @@ fi . /etc/grml/lsb-functions || ( alias einfo=echo ; alias eerror=echo; alias eend=echo ) emulate zsh -autoload -U colors ; colors if [[ -z $DISPLAY ]] ; then # test if X is not running when calling us - if [[ $UID != 0 ]] ; then # test if user root did invoke this command + if [ $(id -u) != 0 ] ; then # test if user root did invoke this command eerror "As of Linux 2.6.15 you need root permissions for changing" - eerror "the keyboard on console using loadkeys for security reasons." + eerror "the keyboard on console using loadkeys for security reasons." eerror "Run this program with root permissions. Exiting." ; eend 1 exit 1 fi @@ -26,8 +24,8 @@ if [[ -z $DISPLAY ]] ; then # test if X is not running when calling us ( einfo "caps-ctrl - switching caps lock and control key." loadkeys <<- EOT - keycode 58 = `repeat 15 echo -n 'Control '` - keycode 29 = `repeat 7 echo -n 'Caps_Lock '` + keycode 58 = $(repeat 15 echo -n 'Control ') + keycode 29 = $(repeat 7 echo -n 'Caps_Lock ') EOT eend $? @@ -35,8 +33,8 @@ if [[ -z $DISPLAY ]] ; then # test if X is not running when calling us einfo "caps-ctrl - switching caps lock and control key." loadkeys <<- EOT - keycode 58 = `repeat 15 echo -n 'Caps_Lock '` - keycode 29 = `repeat 7 echo -n 'Control '` + keycode 58 = $(repeat 15 echo -n 'Caps_Lock ') + keycode 29 = $(repeat 7 echo -n 'Control ') EOT eend $? )