3 if [ "x$1" = "x-s" ]; then
8 if [ "x$1" = x
-o "x$2" = x
]; then
9 echo "ukeyboard-set: Missing parameters."
12 dest
="/usr/share/keyboards/$2.vkb"
14 if [ "x$1" = "x-r" -a ! -f "$dest-saved" -a ! -f "$dest-empty" ]; then
15 echo "ukeyboard-set: No previous file stored."
19 if [ -f "$dest" ]; then
20 if [ ! -h "$dest" ]; then
21 echo "ukeyboard-set: Destination $dest exists and is not a symlink."
24 if [ "$store" != 1 -o -f "$dest-saved" ]; then
26 if [ -f "$dest" ]; then
27 echo "ukeyboard-set: Cannot delete current symlink $dest."
31 mv "$dest" "$dest-saved"
33 elif [ "$store" = 1 ]; then
37 if [ "x$1" = "x-r" ]; then
38 if [ -f "$dest-saved" ]; then
39 mv "$dest-saved" "$dest"
41 rm "$dest" "$dest-empty"
43 elif [ "$store" = 1 ]; then
46 ln -s "../ukeyboard/$1.vkb" "$dest"