Home | Fedora Core 4 Tutorial | Linux Tutorials | Linux Games | Linux Java | Linux Kernal | Linux Firewall | Linux Database | Linux Distributions | Linux Firewall GUI | Linux Distributions | Linux Firewall

 


 

Search Host

Monthly Fee($)
Disk Space (MB)
Register With us for Newsletter!
Visit Forum! Post Questions!
Jobs At RoseIndia.net!

Have tutorials?
Add your tutorial to our Java Resource and get tons of hits.

We offer free hosting for your tutorials. and exposure for thousands of readers. drop a mail
roseindia_net@yahoo.com
 
   

Tutorials

Java Server Pages

JAXB

Java Beans

JDBC

MySQL

Java Servlets

Struts

Bioinformatics

Java Code Examples

Interview Questions

 
Join For Newsletter

Powered by groups.yahoo.com
Visit Group! Post Questions!

Web Promotion

Web Submission

Submit Sites

Manual Submission?

Web Promotion Guide

Hosting Companies

Web Hosting Guide

Web Hosting

Linux

Beginner Guide to Linux Server

Linux Distribution

Major Linux Distribution

Linux FTP Software

Frameworks

Persistence Framework

Web Frameworks

Free EAI Tools

Web Servers

Aspect Oriented Programming

Free Proxy Servers

Softwares

Adware & Spyware Remover

Open Source Softwares

Next Previous Contents

10. The swaphalt.sh script

This script first checks the Linux swap signature and then restores the Windows file system on it.

(Adapted from the original Swap-Space-HOWTO by H. Peter Anvin)

 
#!/bin/sh 
# 
# swaphalt.sh   This file is executed through the /etc/rc.d/init.d/halt 
#               script after swapping and accounting has been turned off. 
# 
# Author:       Rahul U. Joshi 
# 
 
# check swap partition signature and restore Windows swap info 
 
loopcount=0 
 
# flag to indicate whether the swap info has been restored or not 
restored=0 
 
# check for swap signature 3 times before giving up 
while [ $loopcount -lt 3 ] 
  do 
 
  if [ "`/bin/dd 2>/dev/null if=/dev/winswap bs=1 count=10 skip=4086`" = 'SWAP-SPACE' ]; then 
    echo "Restoring DOS/Windows swap info , iteration $loopcount"  
    /bin/zcat /etc/winswap.gz  >  /dev/winswap 
    restored=1 
    break 
  else 
    loopcount=loopcount+1 
  fi 
 
  done 
 
if [ $restored -ne 1 ] ; then 
   echo "Swap signature not found after $loopcount tries" 
   echo "Skipping restoring" 
fi 
 

Next Previous Contents
Search Tutorials

Linux Distributions

Fedora

Slackware
SuSe
Mandrake
Knoppix
Mepis
Debian
All Distors....
 

 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2004. All rights reserved.