LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-11-2009, 05:17 PM   #1
Yerggaddasil
LQ Newbie
 
Registered: Jun 2009
Posts: 4

Rep: Reputation: 0
Scripting Question in Knoppix


I had a few scripts set up in Knoppix 5.1.1 that would create back up images for various laptops. Knoppix 5.1.1 dose not load right on a new laptop so i downloaded Knoppix 6.0.1 and it won't even recognize that my scripts are there. Is there anyway to salvage my scripts for the new distro or would i have to start from scratch?
 
Old 06-12-2009, 10:18 AM   #2
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 71
Quote:
Originally Posted by Yerggaddasil View Post
I had a few scripts set up in Knoppix 5.1.1 that would create back up images for various laptops. Knoppix 5.1.1 dose not load right on a new laptop so i downloaded Knoppix 6.0.1 and it won't even recognize that my scripts are there. Is there anyway to salvage my scripts for the new distro or would i have to start from scratch?
What exactly happens when you're trying to run the scripts? Could you post an example of the error message that the system gives you?
Where exactly are those scripts located in the system? Are they bash scripts or are they in some other language? Are they supposed to be called automatically (from a cron job perhaps) or run by hand?

Sorry, from your description of the problem it's very hard to understand what exactly happened. More info is needed.
 
Old 06-12-2009, 12:04 PM   #3
Yerggaddasil
LQ Newbie
 
Registered: Jun 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Ok here it goes. Please keep in mind i recived these scripts to work with and did not write them myself. Also keep in mind i am fairly new with this
-----------------------------------------
I have an icon Laptop-Restore.desktop with the contents
-----------------------------------------
[Desktop Entry]
Comment=
Comment[en_US]=
Encoding=UTF-8
Exec='/mnt/sda1/imaging/su-restore-laptop.sh'
GenericName=
GenericName[en_US]=
Icon=
MimeType=
Name=
Name[en_US]=
Path=/mnt/sda1/imaging
StartupNotify=true
Terminal=true
TerminalOptions=
Type=Application
X-DCOP-ServiceType=none
X-KDE-SubstituteUID=false
X-KDE-Username=

-------------------------------------
su-restore-laptop.sh
-------------------------------------
#!/bin/bash

clear
# Sudo to root (gain root access).
sudo -s ./restore-laptop.sh
clear

-------------------------------------
restore-laptop.sh
-------------------------------------
#!/bin/bash

USER= 'whoami'

# Check that user is running script as root
if [ $USER = 'root' ]
then
# User is running as root, continue running script....

# Unmount and then remount firewire drive with correct permissions
# umount /mnt/sda1
# mount -o rw /dev/sda1

# Enable DMA - imaging will be very slow if not enabled
hdparm -d1 /dev/hda
sleep 3
clear

# Load appropriate drivers for firewire drive
echo "Loading modules for firewire drive....."
modprobe ieee1394
modprobe ohci1394
modprobe raw1394
sleep 5
clear

else
# User is not running as root; provide instructions on how to proceed
clear
echo
echo -e '\E[37;45m'"You must run this script as root - the script will now exit.... To gain root privileges, type 'su'(without quotes), press Enter and then restart the script with the following command: ./restore-ibm.sh"; tput sgr0
echo
exit 1;
fi

{
# Warn user that hard drive will be overwritten
clear
echo
echo -e '\E[37;45m'"Restore IBM - If you continue the entire contents of the hard drive will be overwritten. All data on the hard rive will be lost"; tput sgr0
echo
echo -n "Do you want to continue (Y/N)?"
read answer
if test "$answer" != "Y" -a "$answer" != "y";
then
exit 0;
fi
clear

# set -x
# Start the actual imaging process now
partimage -f3 -b restore /dev/hda1 /mnt/sda1/images/laptop.000
}
{

# Image has been successfully created, reboot the computer
clear
echo
echo -e '\E[37;45m'"The image has been successfully restored. The system will restart now."; tput sgr0
echo
sleep 5
init 6

}
----------------------------------
now the exact proble is that with four of my 5 laptops i can load Knoppix 5.1.1 and see the laptops.desktop icon, double click it and restore the desired image. The remaining laptop will not load the GUI from knoppix 5.1.1 and so i cant get to the .desktop icon i made for it. I then tried using Knoppix 6.0.1, The GUI comes up fine but when i open my hard drive i dont see any of the .desktop icons in the directory where they should be.

does anyone have any ideas?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
scripting question. mrbutabara Linux - Newbie 8 01-27-2009 09:43 AM
Scripting question nazs Programming 4 04-27-2008 12:48 AM
scripting question. disruptive Programming 5 02-19-2008 01:12 PM
how to configure the printer using shell scripting in knoppix? triple_play45 Linux - Hardware 0 02-26-2006 07:54 PM
Scripting Question... Darklight451 Linux - Newbie 3 09-23-2004 05:03 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration