Changeset 43498
- Timestamp:
- 02/14/19 19:02:51 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/oealliance/var/etc/autostart/start.sh
r43497 r43498 12 12 board=`cat /etc/.board` 13 13 14 startwebif()15 {16 if [ ! -L /var/usr/local/share/titan/web/tmp ];then17 rm -rf /var/usr/local/share/titan/web/tmp18 ln -s /tmp /var/usr/local/share/titan/web/tmp19 fi20 }21 22 14 starthotplug() 23 15 { 24 16 echo "[$0] starthotplug" 25 17 hotplug.sh first 26 }27 28 startautofs()29 {30 echo "[$0] startautofs"31 mkdir -p /mnt/network32 cp /etc/titan.restore/mnt/network/auto.misc /mnt/network33 if [ ! -L /etc/auto.network ];then34 rm /etc/auto.network35 ln -s /mnt/network/auto.misc /etc/auto.network36 fi37 if [ ! -L /etc/udev/mount-helper.sh ];then38 mv /etc/udev/mount-helper.sh /etc/udev/mount-helper_oe.sh39 ln -s /sbin/hotplug.sh /etc/udev/mount-helper.sh40 fi41 cp /etc/titan.restore/etc/auto.master /etc/auto.master42 43 if [ "$1" == "restart" ];then /etc/init.d/autofs restart;fi44 if [ "$1" == "reload" ];then /etc/init.d/autofs reload;fi45 starthotplug46 }47 48 startnetwork()49 {50 echo "[$0] startnetwork $1"51 if [ ! -L /etc/network/interfaces ];then52 rm /etc/network/interfaces53 ln -s /mnt/network/interfaces /etc/network/interfaces54 fi55 if [ ! -L /etc/resolv.conf ];then56 rm /etc/resolv.conf57 ln -s /mnt/network/resolv.conf /etc/resolv.conf58 fi59 if [ "$1" == "restart" ];then /etc/init.d/networking restart;fi60 }61 62 startmnt()63 {64 echo "[$0] startmnt"65 if [ -L /mnt ];then66 rm -f /mnt67 # startautofs reload68 startnetwork restart69 startwebif70 sleep 1071 fi72 73 if [ -e /var/etc/.erasemtd ] || [ ! -e /mnt/swapextensions ]; then74 if [ -e /var/etc/.backupmtd ]; then75 mkdir /tmp/backupmtd76 cp -a /mnt/settings /tmp/backupmtd77 cp -a /mnt/config /tmp/backupmtd78 cp -a /mnt/network /tmp/backupmtd79 cp -a /mnt/script /tmp/backupmtd80 mkdir /tmp/backupmtd/swapextensions81 cp -a /mnt/swapextensions/player /tmp/backupmtd/swapextensions82 backuptpk83 fi84 85 if [ -e /media/hdd/.update/.last ];then86 BACKUPDIR=/media/hdd/.update87 BACKUPFILE=$(cat $BACKUPDIR/.last)88 if [ ! -z "$BACKUPFILE" ];then89 echo "[$0] startmnt: cp -a $BACKUPFILE/* /mnt"90 cp -a $BACKUPFILE/* /mnt91 mv -f $BACKUPDIR/.last $BACKUPDIR/.last.restored92 sync93 echo94 echo "[$0] startmnt: skip cp -a $BACKUPFILE/* /mnt"95 fi96 elif [ -e /var/backup/.update/.last ];then97 BACKUPDIR=/var/backup/.update98 BACKUPFILE=$(cat $BACKUPDIR/.last)99 if [ ! -z "$BACKUPFILE" ];then100 echo "[$0] startmnt: cp -a $BACKUPFILE/* /mnt"101 cp -a $BACKUPFILE/* /mnt102 mv -f $BACKUPDIR/.last $BACKUPDIR/.last.restored103 sync104 echo105 echo "[$0] startmnt: skip cp -a $BACKUPFILE/* /mnt"106 fi107 elif [ -e /var/swap/.update/.last ];then108 BACKUPDIR=/var/swap/.update109 BACKUPFILE=$(cat $BACKUPDIR/.last)110 if [ ! -z "$BACKUPFILE" ];then111 echo "[$0] startmnt: cp -a $BACKUPFILE/* /mnt"112 cp -a $BACKUPFILE/* /mnt113 mv -f $BACKUPDIR/.last $BACKUPDIR/.last.restored114 sync115 echo116 echo "[$0] startmnt: skip cp -a $BACKUPFILE/* /mnt"117 fi118 else119 infobox -pos -1 75% 10015 "MNT" " Formatiere Laufwerk " &120 if [ -e /mnt ];then121 echo "remove mnt files"122 rm -rf /mnt123 fi124 cp -a /etc/titan.restore/mnt /125 mkdir /mnt/swapextensions126 mkdir /mnt/bin127 mkdir /mnt/tpk128 sleep 10129 130 if [ -e /var/etc/.backupmtd ]; then131 restoretpk132 133 rm -rf /mnt/settings134 rm -rf /mnt/config135 rm -rf /mnt/network136 rm -rf /mnt/script137 rm -rf /mnt/swapextensions/player138 cp -a /tmp/backupmtd/* /mnt139 # else140 # mkdir /mnt/tpk141 # mkdir /mnt/script142 # reset.sh143 fi144 145 rm -r /var/etc/.erasemtd146 rm -r /var/etc/.backupmtd147 148 #ubifs needs sync149 sync150 151 #startMicomUpdate152 153 # killall infobox154 # infobox 9999 INFO "Initializing MNT" "" "you can power off the receiver now," "in case it does not reboot" &155 # sleep 2156 reboot157 fi158 startnetwork restart159 fi160 }161 162 startopkg()163 {164 if [ $(cat /etc/opkg/opkg.conf | grep "dest / /" | wc -l) -eq 0 ];then165 echo "dest /var /var" >> /etc/opkg/opkg.conf166 fi167 if [ $(cat /etc/opkg/opkg.conf | grep "dest /mnt/swapextensions /mnt/swapextensions" | wc -l) -eq 0 ];then168 echo "dest /mnt/swapextensions /mnt/swapextensions" >> /etc/opkg/opkg.conf169 fi170 if [ $(cat /etc/opkg/opkg.conf | grep "dest /var/swap /var/swap" | wc -l) -eq 0 ];then171 echo "dest /var/swap /var/swap" >> /etc/opkg/opkg.conf172 fi173 18 } 174 19 … … 247 92 cd /home/root 248 93 export HOME=/home/root 249 fi250 }251 252 startplugins()253 {254 if [ ! -L /var/usr/local/share/titan/plugins ];then255 rm -rf /var/usr/local/share/titan/plugins256 ln -sf /usr/local/share/titan/plugins /var/usr/local/share/titan/plugins257 94 fi 258 95 } … … 457 294 case $1 in 458 295 first) 459 startmnt460 startplugins296 # startmnt 297 # startplugins 461 298 # starthotplug 462 299 startemu 463 startopkg300 # startopkg 464 301 startdate 465 302 startbootlogo
Note: See TracChangeset
for help on using the changeset viewer.