Like this topic, before I were unable to notify, that bro tried with SuSE.
As you all know, how many of distro variants for GNU/Linux and even more if counting BSD in.. So, those, those users and need ur help on my project packaging. Help test, debug and commit me for the packaging code.
For now, i tried write shell script installer for Fedora and Ubuntu for UniBurma keyboard installation. Since my box is Fedora, so Fedora script is ok. But i think Ubuntu is broken.
The script shipped with UniBurma current latest release V 2.0.1 package. The doc links are at:
http://www.unimm.org/xkbinstall/
http://uniburma.blogspot.com/2007/10/un ... -only.html
installkb.ub6
- Code: Select all
#!/bin/sh
#############################################################
# This is a small piece of user interactive shell installer script for UniBurma Keyboard installation.
# Original author: Victor San Kho Lin <victor.sankholin@mmlug.org or gmail.com> | sankholin.com | mmglug.org | unimm.org
# Contributors:
# Last Update: 8-Sept-2007
#
#
#
#
##############################################################
if apt-cache policy dialog #dpkg -l | grep dialog #dialog
then
dialog --title "Alert : Using a right shell script installer?" --backtitle "UniBurma Shell Script \
Installer" --yesno "\nOne last question. You are running Ubuntu 6 or up? If so, select Yes and close all running applications now. Because installer \
need to restart your X window after installation completed. You have to type \"startx\" command while console prompting." 8 100
sel=$?
case $sel in
0) cp -f /etc/X11/xkb/symbols/mm /etc/X11/xkb/symbols/mm.bak
sleep 1
echo "Backup Ok."
sleep 1
rm -f /etc/X11/xkb/symbols/mm
echo "Deleted Old Layout."
sleep 1
cp -v mm /etc/X11/xkb/symbols/
sleep 1
echo "Installation completed!"
sleep 1
echo "Going to restart X for taking effect."
sleep 2
echo "Please re-login or startx, startxfce4 again."
sleep 1 | echo .
sleep 1 | echo ..
sleep 1 | echo ....
sleep 1 | echo ........
sleep 1 | echo .............
# different commands of restarting x, comment in/out to adjust your system
sudo pkill X
#init 3
#/etc/init.d/xdm restart
#/etc/init.d/gdm restart
#/etc/init.d/kdm restart
#exit
;;
1) echo "Good. Choose your respective distro shell scipt, tail the name with extension.";;
255) echo "Canceled by user by pressing [ESC] key";;
esac
else
installdialog=0
echo "You don't have dialog utility. Please install it by \"apt-get install dialog\" or I shall do this for you?";
echo "1. Yah, Install it for me."
echo "2. No. I will do myself."
echo -n "Select your choice [1 or 2]? "
read installdialog
if [ $installdialog -eq 1 ] ; then
echo "Ok. I will install dialog utility for you. Please re-run this installer script after dialog utility installed."
sleep 1 | echo .
sleep 1 | echo ...
sleep 1 | echo ......
sleep 1 | echo ...........
echo "Going out from UniBurma installer script. Starting dialog utility apt-get installation...."
sleep 1
apt-get install dialog
else #### nested if i.e. if within if ######
if [ $installdialog -eq 2 ] ; then
echo "Ok. Please install dialog utility and re-run the installer script again."
else
echo "What are you trying to say?? I ask you 1 or 2. Please re-run the installer script."
fi
fi
fi
I think the problem is at the fist line, checking dialog program if statement. I intend to check whether dialog program is available or not. Any idea? Or any other terminal message command?
The following is a working script for fedora, same logic. I wrote primary on Fedora, so ubuntu script is derived from the following fedora script.
installkb.fc6
- Code: Select all
#!/bin/sh
#############################################################
# This is a small piece of user interactive shell installer script for UniBurma Keyboard installation.
# Original author: Victor San Kho Lin <victor.sankholin@mmlug.org or gmail.com> | sankholin.com | mmglug.org | unimm.org
# Contributors:
# Last Update: 8-Sept-2007
#
#
#
#
##############################################################
if rpm -q dialog
then
dialog --title "Alert : Using a right shell script installer?" --backtitle "UniBurma Shell Script \
Installer" --yesno "\nOne last question. You are running Fedora Core 6 or up? If so, select Yes and close all running applications now. Because installer \
need to restart your X window after installation completed. You have to type \"startx\" command while console prompting." 8 100
sel=$?
case $sel in
0) cp -f /usr/share/X11/xkb/symbols/mm /usr/share/X11/xkb/symbols/mm.bak
sleep 1
echo "Backup Ok."
sleep 1
rm -f /usr/share/X11/xkb/symbols/mm
echo "Deleted Old Layout."
sleep 1
cp -v mm /usr/share/X11/xkb/symbols/
sleep 1
echo "Installation completed!"
sleep 1
echo "Going to restart X for taking effect."
sleep 2
echo "Please re-login or startx, startxfce4 again."
sleep 1 | echo .
sleep 1 | echo ..
sleep 1 | echo ....
sleep 1 | echo ........
sleep 1 | echo .............
# different commands of restarting x, comment in/out to adjust your system
sudo pkill X
#init 3
#/etc/init.d/xdm restart
#/etc/init.d/gdm restart
#/etc/init.d/kdm restart
#exit
;;
1) echo "Good. Choose your respective distro shell scipt, tail the name with extension.";;
255) echo "Canceled by user by pressing [ESC] key";;
esac
else
installdialog=0
echo "You don't have dialog utility. Please install it by \"yum install dialog\" or I shall do this for you?";
echo "1. Yah, Install it for me."
echo "2. No. I will do myself."
echo -n "Select your choice [1 or 2]? "
read installdialog
if [ $installdialog -eq 1 ] ; then
echo "Ok. I will install dialog utility for you. Please re-run this installer script after dialog utility installed."
sleep 1 | echo .
sleep 1 | echo ...
sleep 1 | echo ......
sleep 1 | echo ...........
echo "Going out from UniBurma installer script. Starting dialog utility yum installation...."
sleep 1
yum install dialog
else #### nested if i.e. if within if ######
if [ $installdialog -eq 2 ] ; then
echo "Ok. Please install dialog utility and re-run the installer script again."
else
echo "What are you trying to say?? I ask you 1 or 2. Please re-run the installer script."
fi
fi
fi
Pls also suggest/commit for better code and logic beautify also, such as sed, awk, etc... And port for other distro.
