/[clonezilla-sysresccd]/trunk/create-clonezilla-sysresccd/files/prerun.toram
ViewVC logotype

Annotation of /trunk/create-clonezilla-sysresccd/files/prerun.toram

Parent Directory Parent Directory | Revision Log Revision Log


Revision 47 - (hide annotations)
Thu May 20 12:12:53 2010 UTC (13 years, 10 months ago) by sng
File size: 2483 byte(s)
adding release scripts

1 sng 47 #!/bin/sh
2     setterm -foreground yellow
3     echo '
4     ##########################################'
5     setterm -foreground white
6     echo -n " Modifying .bashrc ... "
7     echo >> /root/.bashrc
8     echo "##########################################" >> /root/.bashrc
9     echo "# aliases by Spiros" >> /root/.bashrc
10     echo "##########################################" >> /root/.bashrc
11     echo "# aliases..." >> /root/.bashrc
12     echo "alias ls='ls --color'" >> /root/.bashrc
13     echo "alias lf='ls -F --color'" >> /root/.bashrc
14     echo "alias l='ls -la --color'" >> /root/.bashrc
15     echo "##########################################" >> /root/.bashrc
16     setterm -foreground green;echo 'done';setterm -foreground white
17    
18    
19    
20     #
21     # replace /live/image/restorecd with $restorecdFiles
22     #
23     echo -n " Copying new scripts... "
24     for script in what-cd continue-multi-cd reloc-img imginfo imgconvert sbminst;do
25     cp /live/image/restorecd/"$script" /usr/bin 2>/dev/null
26     chmod +x /usr/bin/"$script" 2>/dev/null
27     done
28     cp /live/image/restorecd/ocs-iso /opt/drbl/sbin
29     cp /live/image/restorecd/cust-menu /opt/drbl/sbin
30     chmod +x opt/drbl/sbin/ocs-iso
31     chmod +x opt/drbl/sbin/cust-menu
32     setterm -foreground green;echo 'done';setterm -foreground white
33    
34     setterm -foreground yellow
35     echo '##########################################
36     '
37     setterm -foreground white
38     #
39     # execute S09mountcd
40     #
41     # only when auto-restore and load to RAM
42     #
43     #
44     echo
45     echo -n "Trying to determine and mount your CD-ROM... "
46     rm -rf /home/partimag 2>/dev/null
47     mkdir /home/partimag
48    
49     # search all CDs
50     for n in $(cat /proc/sys/dev/cdrom/info | grep 'drive name' |sed 's|drive name:[ \t]*||' | awk '{for(i=1;i<=NF;i++) print $i}')
51     do
52     mount /dev/"$n" /home/partimag 2>/dev/null && {
53     if [ -e /home/partimag/restorecd/ocswp.png ];then
54     break
55     else
56     umount /home/partimag 2>/dev/null
57     fi
58     }
59     done
60    
61     # search all partitions
62     if [ -z "$(mount | grep /home/partimag)" ];then
63     for n in $(cat /proc/partitions | grep [0-9]$ | sed 's|.* ||' | grep -v loop)
64     do
65     mount /dev/"$n" /home/partimag 2>/dev/null && {
66     if [ -e /home/partimag/restorecd/ocswp.png ];then
67     break
68     else
69     umount /home/partimag 2>/dev/null
70     fi
71     }
72     done
73     fi
74    
75     if [ -z "$(mount | grep /home/partimag)" ];then
76     setterm -foreground magenta
77     echo failed
78     setterm -foreground white
79     echo
80     echo "Mounting the System Image has failed... You should boot"
81     echo " Clonezilla Live to RAM for this to work!!!"
82     echo "Press ENTER to restart..."
83     read
84     reboot
85     exit 1
86     fi
87    
88     setterm -foreground green
89     echo 'done
90     '
91     setterm -foreground white

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26