home *** CD-ROM | disk | FTP | other *** search
- #! /bin/sh
-
- PATH=/sbin:/etc:/bin:/usr/bin
-
- stty onlcr
-
- echo "Running shutdown script $0:"
-
- case "$0" in
- *0)
- command="halt"
- ;;
- *6)
- command=reboot
- ;;
- *)
- echo "$0: call me as \"rc.0\" or \"rc.6\" please!"
- exit 1
- ;;
- esac
-
- if [ ! -e /etc/REBOOT ]
- then
-
- killall lpd
- umount /mnt/C/socd/spool
- losetup -d /dev/loop0
-
- mv /etc/mtab /tmp
- mv /etc/fstab /tmp
-
- echo "Sichere Systemzustand..."
- if [ `grep -c "/mnt " /proc/mounts` -ne 0 ]
- then
- if [ `cat "/etc/RUN"` -eq "1" ]
- then
- tar czf /mnt/C/linux/etc.tgz /etc
- elif [ ` cat "/etc/RUN" ` -eq "2" ]
- then
- tar czf /mnt/C/linux/etc.tgz.old /etc
- if [ -e /mnt/C/linux/etc.tgz ]
- then
- rm /mnt/C/linux/etc.tgz
- fi
- elif [ ` cat "/etc/RUN" ` -eq "0" ]
- then
- cp /mnt/C/linux/etc.tgz.old /mnt/C/linux/etc.tgz
- if [ -e /mnt/C/linux/etc.tgz.old ]
- then
- rm /mnt/C/linux/etc.tgz.old
- fi
- fi
- fi
-
- mv /tmp/mtab /etc
- mv /tmp/fstab /etc
-
- fi
-
- umount -a
-
- if [ "$1" != "fast" ]; then
- killall5 -15
- sleep 5
- killall5 -9
- fi
-
- $command -w
-
- sync
- sleep 1
- wait
-
- if [ "$command" = "reboot" ]; then
- echo "Rebooting."
- reboot
- else
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " *********************************************"
- echo " * *"
- echo " * You can switch off the PC now. *"
- echo " * *"
- echo " *********************************************"
- echo " "
- echo " "
- poweroff
- fi
-