Last change
on this file since 1633 was 71, checked in by bcornec, 19 years ago |
On ia64 you may have more than 4 primary partitions
|
-
Property svn:keywords
set to
Id
|
File size:
1.6 KB
|
Rev | Line | |
---|
[1] | 1 | #!/bin/sh
|
---|
| 2 | #
|
---|
[71] | 3 | # $Id: autorun 71 2005-10-20 00:06:39Z bcornec $
|
---|
| 4 | #
|
---|
[1] | 5 | # Autorun script for mondorestore CD - Hugo Rabson
|
---|
| 6 | #
|
---|
| 7 | # Based on autorun script for the Ark Development Suite
|
---|
| 8 | # Copyright (c) 2002 Bernhard Rosenkraenzer <bero@arklinux.org>
|
---|
| 9 | ##################################################################
|
---|
| 10 |
|
---|
| 11 | InBkgd() {
|
---|
| 12 | cd /
|
---|
| 13 | sleep 1
|
---|
| 14 | umount $1 &> /dev/null
|
---|
| 15 | eject $2 &> /dev/null
|
---|
| 16 | }
|
---|
| 17 |
|
---|
| 18 |
|
---|
| 19 | run_command_as_root() {
|
---|
| 20 | local command fnam subcom
|
---|
| 21 |
|
---|
| 22 | subcom="$1"
|
---|
| 23 | command="xterm -e $subcom"
|
---|
| 24 | if which kdesux &> /dev/null ; then
|
---|
| 25 | kdesu +sb -c "$command"
|
---|
| 26 | else
|
---|
| 27 | fnam=/tmp/$$.$RANDOM.sh
|
---|
| 28 | echo -en "echo -en \"\
|
---|
| 29 | To run mondorestore, you need to be root.\n\
|
---|
| 30 | Please enter root's password now to proceed,\n\
|
---|
| 31 | or press <Ctrl>-C to abort installation.\n\"\n\
|
---|
| 32 | su - -c $subcom\n" > $fnam
|
---|
| 33 | chmod +x $fnam
|
---|
| 34 | xterm -e "$fnam"
|
---|
| 35 | rm -f $fnam
|
---|
| 36 | fi
|
---|
| 37 | }
|
---|
| 38 |
|
---|
| 39 | # ------------------------- main -------------------------
|
---|
| 40 |
|
---|
| 41 | if [ -d "`dirname $0`" ]; then
|
---|
| 42 | cd "`dirname $0`"
|
---|
| 43 | fi
|
---|
| 44 |
|
---|
| 45 | q=`pwd`
|
---|
| 46 | r=`mount | grep $q | tr -s ' ' '\t' | cut -f1`
|
---|
| 47 |
|
---|
| 48 | ps ax | grep mondoarchive | grep -v grep && exit 0
|
---|
| 49 | ps ax | grep mondorestore | grep -v grep && exit 0
|
---|
| 50 |
|
---|
| 51 | mr=`which mondorestore`
|
---|
| 52 | if [ ! "$mr" ] ; then
|
---|
| 53 | p=$q/usr
|
---|
| 54 | mr=`find $p -name mondorestore -type f | head -n1`
|
---|
| 55 | [ ! -x "$mr" ] && mr=`find /mnt/cdrom -name mondorestore -type f | head -n1`
|
---|
| 56 | if [ -x "$mr" ] ; then
|
---|
| 57 | old_mr=$mr
|
---|
| 58 | new_mr=/tmp/$RANDOM.$RANDOM.$RANDOM
|
---|
| 59 | cp -f $old_mr $new_mr
|
---|
| 60 | mr=$new_mr
|
---|
| 61 | fi
|
---|
| 62 | fi
|
---|
| 63 | if [ -x "$mr" ] ; then
|
---|
| 64 | ls `pwd`/archives/0.afio* && additional="--live-from-cd"
|
---|
| 65 | cd /
|
---|
| 66 | umount /mnt/cdrom
|
---|
| 67 | subcom="$mr $additional"
|
---|
| 68 | run_command_as_root "$subcom"
|
---|
| 69 | fi
|
---|
| 70 | [ "$new_mr" ] && rm -f $new_mr
|
---|
| 71 | exit $?
|
---|
Note:
See
TracBrowser
for help on using the repository browser.