Sponsored Content
Top Forums Shell Programming and Scripting Restart and then continue script Post 302477908 by wolfgangcs on Monday 6th of December 2010 05:40:31 PM
Old 12-06-2010
Add the code you provided and I got this:

Reading package lists... Done
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
update failed

here is what is put:

Code:
#Start Setup
#Let the craziness commence

#First update begins
if [ "$Update1" == "Y" ]
then
     sudo apt-get update -y
else
     echo "Skipping first Update"
fi
sleep 1
#Apply changes to be made in update manager VIA-script

#Confirm Competition of update

#add itself to "startup apps"

#Delete the above lines so it will not repeat the same actions again

#Reboot
case "$INSTALLSTATE" in
INSTALL)
        # continue install stuff
        ;;
*)     if apt-get update 
        then
		echo "Hit control c now"
		sleep 10
                echo "INSTALL" > /path/to/state
                /sbin/reboot
        else
                echo "update failed" >&2
                exit 1
        fi
        ;;
esac

#continue script...

---------- Post updated at 05:40 PM ---------- Previous update was at 05:36 PM ----------

Quote:
Originally Posted by Corona688
Unless you're updating the kernel, why's a reboot needed?
on the clean install the first update will most likely need a restart from the update manager

so yes maybe be dealing with a new kernel
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Continue Script when File Found

Hello All, I am trying to write a script that will only continue executing my script if a file exits. I know the directory of the file, so its just a matter of seeing if the file exists yet. If the file has not yet been created, I want the script to wait 10 minutes (600 seconds) and try again.... (7 Replies)
Discussion started by: Jose Miguel
7 Replies

2. Shell Programming and Scripting

continue line in perl script

HI , I am new to the perl , I am using a if condition and in that if condition i am checking 7 variables value. so it continue to second line .And if i user "\" for the continue line it showing error. Example : if(a >9 || b>8 || c> 10 \ d > 11) { print(); } The above statement is... (3 Replies)
Discussion started by: julirani
3 Replies

3. Shell Programming and Scripting

How to continue script if right word is not entered?

Hello, I am writing a script and in this script, I want to be able to have the script continue running if the correct word is not entered... Here is an excerpt from me script: read request if ; then echo "You have asked for the System Temperature..." cat... (1 Reply)
Discussion started by: niconico96
1 Replies

4. Shell Programming and Scripting

Issue with Error handling,not able to continue the script further

Hi, I am trying to write a script to cleanup files in a log directory .. cd log find Datk** -mtime +7 -exec rm -f {} \; 2> /dev/null Have used the above to clean up files in log directory more then 7 days older. The file can be something like ( auto-generate by some processes and... (2 Replies)
Discussion started by: nss280
2 Replies

5. Shell Programming and Scripting

Doing a tail in a script and then return back and continue script

Hello all, I am trying to do a tail in a script. But when I quit the tail my script quits also. This is not what I want. I am struggling to get this done. #!/bin/bash askFile() { echo -n "Enter file: " read FILE } doTail() { tail -F "${1}" } askFile doTail... (4 Replies)
Discussion started by: markdark
4 Replies

6. Shell Programming and Scripting

How to continue running a script while offline?

Hi there, I'm not really stranger to Linux and shell scripting but I am to servers. Anyway, I usually run scripts on a shared science machine, accessible via ssh. My scripts are usually run with mpi, e.g. mpirun -np 16 ./my_script the things after entering the science machine and running... (6 Replies)
Discussion started by: matteo86
6 Replies

7. Shell Programming and Scripting

Continue an instruction on more than one line in a script shell ?

Hello, I have a very long instruction to write, but, for lisibility reasons, I would like to cut it on more than one line and comment each lines. is it possible ? thanks :b: (1 Reply)
Discussion started by: shadok
1 Replies

8. Shell Programming and Scripting

solaris create password in a script and continue

:eek:Below is my code to create a user account but it doesn't take a password automatically. I have to run the password command seperately to do this What I want to do is to be able to accept the password in a script. In linux with the "useradd' command you can give the "-p" flag to accept the... (3 Replies)
Discussion started by: slufoot80
3 Replies

9. Shell Programming and Scripting

Script will keep checking running status of another script and also restart called script at night

I am using blow script :-- #!/bin/bash FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not if then # echo "process found" exit 0; else echo "process not found" exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
Discussion started by: ketanraut
1 Replies

10. UNIX for Beginners Questions & Answers

How to continue shell script after exit 0?

Hi, I am writing a shell script where I am sourcing other shell script in that script I have mention exit 0 due to that it is not continue the first script. Except doing any changes to source script is there any way I can continue the my first script. (3 Replies)
Discussion started by: sonujatav
3 Replies
UPDATE-RCCONF-GUIDE(8)						 Debian GNU/Linux					    UPDATE-RCCONF-GUIDE(8)

NAME
update-rcconf-guide - Create default guide file for rcconf SYNOPSIS
update-rcconf-guide DESCRIPTION
Update-rcconf-guide creates the default guide file which rcconf uses. Update-rcconf-guide searches the package names corresponding to each service file in /etc/init.d directory from dpkg info files(/var/lib/dpkg/info/*.list) and get the description of these packages using apt-cache. Update-rcconf-guide uses Short-Description in priority to the description if service files has Short-Description field. Update-rcconf-guide writes those results to /var/lib/rcconf/guide.default file. You can write your own guide in user guide file(/var/lib/rcconf/guide) by hand. Rcconf refers Guides in /var/lib/rcconf/guide before those in /var/lib/rcconf/guide.default. If you install some packages after executed update-rcconf-guide, you need to re-create this file using update-rcconf-guide so as to refresh guide.default that includes new guides for installed new services. Notice: update-rcconf-guide was not executed when you installed rcconf package. FILE
/var/lib/rcconf/guide.default Guide File update-rcconf-guide generates. /var/lib/rcconf/guide Guide File user(Administrator) can define. SEE ALSO
rcconf(8) AUTHOR
Atsushi KAMOSHIDA <kamop@debian.org> perl v5.10.1 2009-01-21 UPDATE-RCCONF-GUIDE(8)
All times are GMT -4. The time now is 03:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy