Thread: gksu and gksudo won't work correctly in my bash script
whats problem in script? gksu , gksudo won't work correctly in bash script !!
#!/bin/bash
# --------------------------------------------------
# author: mahdi pishguy
# homepage: http://www.debian-ir.com/
#
#
# gutil free software; can redistribute and/or modify
# under terms of gnu general public license published by
# free software foundation; either version 2 of license, or
# (at option) later version.
# --------------------------------------------------
#gconftool -s --type bool /apps/update-notifier/auto_launch false
while true; do
mainmenu=$(zenity --list --width 550 --height 400 --title "alachiq os administration utilities" --text "please enter choice..." --column "choice" "install vga driver" "update xorg configuration ouput video separator" "force reload & reconfigure xorg(requires x restart or system reboot)" "force reconfigure bootup alachiq(requires system reboot)" "automatically mark known bad sectors" "install graphical boot of alachiq os" "update boot loader resolution" "add windows bootup menu on grub/burg" "install php-gtk" "enable/disable update notifier" "visit online alachiqos support" "quit alachiq os administration utilities" );
case $mainmenu in
"install vga driver")
vga=$(zenity --list --width 550 --height 400 --text "which vga driver must installing?" --column "vga driver" "nvidia" "ati" "unknow (such onboard or etc)");
case $vga in
"nvidia")
zenity --width=400 --height=100 \
--info --title="alachiq os proprietary graphics driver offline installer" \
--text="this utility meant computers poor or no internet connection , don't need running/useing apt-get update" \
gksu -m 'please enter own password' cp /opt/restricted-drivers/nvidia*.deb /var/cache/apt/archives
(
echo "20" ; sleep 1
sudo dpkg -i /var/cache/apt/archives/nvidia*.deb /var/cache/apt/archives
echo "40" ; sleep 1
sudo nvidia-xconfig
) |
zenity --progress \
--title="installing nvidia video driver" \
--text="please wait complete install , reconfigure xorg.conf (requires x restart)..." \
--percentage=0
;;
"ati")
zenity --width=400 --height=100 \
--info --title="alachiq os proprietary graphics driver offline installer" \
--text="this utility meant computers poor or no internet connection , don't need running/useing apt-get update" \
(
echo "10" ; sleep 1
gksu cp /opt/restricted-drivers/bcmwl*.deb /var/cache/apt/archives
echo "20" ; sleep 1
sudo cp /opt/restricted-drivers/fglrx*.deb /var/cache/apt/archives
echo "40" ; sleep 1
sudo dpkg -i /var/cache/apt/archives/bcmwl*.deb
echo "60" ; sleep 1
sudo dpkg -i /var/cache/apt/archives/fglrx*.deb
) |
zenity --progress \
--title="installing ati video driver" \
--text="please wait complete install (requires x restart)..." \
--percentage=0
;;
"unknow (identifier vga driver)")
(
echo "20" ; sleep 1
sh /usr/bin/video_info
) |
zenity --progress \
--title="installing ati video driver" \
--text="please wait complete install (requires x restart)..." \
--percentage=0
;;
esac
;;
"update xorg configuration oouput video separator")
exec gksu sep_video
;;
"force reconfigure bootup alachiq(requires system reboot)")
boot=$(zenity --list --width 550 --height 400 --text "which boot loader alachiq installed?" --column "boot loader" "grub" "burg-graphical alachiq os");
case $boot in
"grub")
(
echo "20" ; sleep 1
gksu update-grub
) |
zenity --progress \
--title="reconfigure grub alachiq os" \
--text="please reboot system after configured..." \
--percentage=0
;;
"burg-graphical alachiq os")
(
echo "20" ; sleep 1
gksu update-burg
) |
zenity --progress \
--title="reconfigure burg-graphical of alachiq os" \
--text="please reboot system after configured..." \
--percentage=0
;;
esac
;;
"visit online alachiq os support")
firefox http://www.alachiq.debian-ir.com
;;
"add windows bootup menu on grub/burg")
addwinpart=$(zenity --list --width 550 --height 400 --text "which boot loader must adding?" --column "boot loader" "grub" "burg-graphical alachiq os");
case $addwinpart in
"grub")
(
echo "20" ; sleep 1
gksu echo "menuentry 'microsoft windows' --class os { insmod ntfs set root='(hd0,msdos0)' chainloader +1} " >> /boot/grub/grub.cfg
) |
zenity --progress \
--title="reconfigure grub alachiq os" \
--text="please reboot system after configured..." \
--percentage=0
;;
"burg-graphical alachiq os")
(
echo "20" ; sleep 1
gksudo -m 'passoed???' echo "menuentry 'microsoft windows' --class os { insmod ntfs set root='(hd0,msdos0)' chainloader +1} " >> /boot/burg/burg.cfg
) |
zenity --progress \
--title="reconfigure burg-graphical of alachiq os" \
--text="please reboot system after configured..." \
--percentage=0
;;
esac
;;
"quit alachiq os administration utilities")
exit
;;
esac
done
Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [ubuntu] gksu and gksudo won't work correctly in my bash script
Ubuntu
Comments
Post a Comment