Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/dracut/mcored/run-mcored.sh.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2240 by niro, Sat Jan 11 00:40:11 2014 UTC revision 2327 by niro, Fri Jul 11 13:15:12 2014 UTC
# Line 1  Line 1 
1  #!/bin/sh  #!/bin/sh
2    
3  if [ -x @@SBINDIR@@/sslsvd -a -x @@SBINDIR@@/mcored -a -x @@SBINDIR@@/udhcpc -a -f @@CONFDDIR@@/mcored -a -f @@CONFDDIR@/network ]  need_remount=0
4    
5    if [ -x @@SBINDIR@@/sslsvd -a -x @@SBINDIR@@/mcored -a -f @@CONFDDIR@@/mcored ]
6  then  then
7   if getargbool 1 rd.mcored   if getargbool 1 rd.mcored && getargbool 0 rd.neednet && NEEDNET=1
8   then   then
9   . /lib/dracut-lib.sh   # print ip config
10   . /lib/net-lib.sh   echo "Current ip settings:"
11   . @@CONFDDIR@@/network   echo "$(ip addr)"
12     [ -w / ] || need_remount=1
13   # sane defaults   if [[ ${need_remount} = 1 ]]
  [[ -z ${DEFAULT_DHCP_START} ]] && DEFAULT_DHCP_START="-T10 -t3 -n -x hostname:$(hostname) -i"  
   
  _myiface="$(find_iface_with_link)"  
  if [[ -n ${_myiface} ]]  
14   then   then
15   # setup networking   # remount /sysroot writeable
16   info "Setup networking"   echo "Remount /sysroot writeable"
  @@BINDIR@@/ip link set "${_myiface}" up  
  @@SBINDIR@@/udhcpc ${DEFAULT_DHCP_START} "${_myiface}"  
  # print ip config  
  info "Current ip settings:"  
  info "$(ip addr)"  
  # remont /sysroot writeable  
  info "Remount /sysroot writeable"  
17   mount -oremount,rw /sysroot   mount -oremount,rw /sysroot
18   # start mcored   else
19   info "Starting mcore daemon"   echo "Already a rw filesystem, remount not required"
20   export MROOT=/sysroot   fi
21   . @@CONFDDIR@@/mcored   # start mcored
22   @@SBINDIR@@/sslsvd -U ${SSL_USER} -/ ${CHROOT_DIR} \   echo "Starting mcore daemon"
23   -Z ${SSL_CERT} -K ${SSL_KEY} \   export MROOT=/sysroot
24   0 6666 @@SBINDIR@@/mcored   . @@CONFDDIR@@/mcored
25     @@SBINDIR@@/sslsvd -U ${SSL_USER} -/ ${CHROOT_DIR} \
26     -Z ${SSL_CERT} -K ${SSL_KEY} \
27     0 6666 @@SBINDIR@@/mcored
28     if [[ ${need_remount} = 1 ]]
29     then
30   # remount sysroot read-only   # remount sysroot read-only
31   info "Remount /sysroot read-only"   echo "Remount /sysroot read-only"
32   mount -oremount,ro /sysroot   mount -oremount,ro /sysroot
33   fi   fi
34   fi   fi

Legend:
Removed from v.2240  
changed lines
  Added in v.2327