ntnu-b2xx: Added some services. (force_10mbit, rtc, rtklib, vsp_pair)
This commit is contained in:
		
							
								
								
									
										9
									
								
								systems/ntnu-b2xx/fs/etc/rc.d/force_10mbit
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								systems/ntnu-b2xx/fs/etc/rc.d/force_10mbit
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
start()
 | 
			
		||||
{
 | 
			
		||||
    ethtool -s eth0 speed 10 duplex full autoneg off
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
stop()
 | 
			
		||||
{
 | 
			
		||||
    ethtool -s eth0 autoneg on
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										10
									
								
								systems/ntnu-b2xx/fs/etc/rc.d/rtc-ds3231
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								systems/ntnu-b2xx/fs/etc/rc.d/rtc-ds3231
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
start()
 | 
			
		||||
{
 | 
			
		||||
    echo ds3231 0x68 >/sys/bus/i2c/devices/i2c-2/new_device
 | 
			
		||||
    hwclock -f /dev/rtc1 -s
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
stop()
 | 
			
		||||
{
 | 
			
		||||
    echo "no stop-operation for rtc"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										27
									
								
								systems/ntnu-b2xx/fs/etc/rc.d/rtklib_rtkrcv
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								systems/ntnu-b2xx/fs/etc/rc.d/rtklib_rtkrcv
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
start()
 | 
			
		||||
{
 | 
			
		||||
    rtkrcv -s -o /etc/rtklib/conf/rtkrcv.conf  < /dev/null > /dev/null 2>&1 &
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
stop()
 | 
			
		||||
{
 | 
			
		||||
        while [ 1 ]; do
 | 
			
		||||
        echo "* Stopping process..."        
 | 
			
		||||
        killall rtkrcv > /dev/null 2>&1
 | 
			
		||||
 | 
			
		||||
       
 | 
			
		||||
        for r in 0 1 2 3 4 5 6 7 8 9; do
 | 
			
		||||
            if [ -n "$(pidof rtkrcv)" ]; then
 | 
			
		||||
                echo "* Waiting for process to exit ($r)..."
 | 
			
		||||
                sleep 1
 | 
			
		||||
            else
 | 
			
		||||
                echo "* Process not running."
 | 
			
		||||
                return 1
 | 
			
		||||
            fi
 | 
			
		||||
        done
 | 
			
		||||
 | 
			
		||||
        echo "* Forcing exit..."
 | 
			
		||||
        killall -9 rtkrcv > /dev/null 2>&1
 | 
			
		||||
        sleep 1
 | 
			
		||||
    done
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										27
									
								
								systems/ntnu-b2xx/fs/etc/rc.d/rtklib_str2str
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								systems/ntnu-b2xx/fs/etc/rc.d/rtklib_str2str
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
start()
 | 
			
		||||
{
 | 
			
		||||
    str2str -in serial://uart/2:9600:8:n:1:off -c /etc/rtklib/data/ubx_raw_10hz.cmd -out tcpsvr://:50022 < /dev/null > /dev/null 2>&1 &
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
stop()
 | 
			
		||||
{
 | 
			
		||||
        while [ 1 ]; do
 | 
			
		||||
        echo "* Stopping process..."        
 | 
			
		||||
        killall str2str > /dev/null 2>&1
 | 
			
		||||
 | 
			
		||||
       
 | 
			
		||||
        for r in 0 1 2 3 4 5 6 7 8 9; do
 | 
			
		||||
            if [ -n "$(pidof str2str)" ]; then
 | 
			
		||||
                echo "* Waiting for process to exit ($r)..."
 | 
			
		||||
                sleep 1
 | 
			
		||||
            else
 | 
			
		||||
                echo "* Process not running."
 | 
			
		||||
                return 1
 | 
			
		||||
            fi
 | 
			
		||||
        done
 | 
			
		||||
 | 
			
		||||
        echo "* Forcing exit..."
 | 
			
		||||
        killall -9 str2str > /dev/null 2>&1
 | 
			
		||||
        sleep 1
 | 
			
		||||
    done
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										27
									
								
								systems/ntnu-b2xx/fs/etc/rc.d/vsp_pair
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								systems/ntnu-b2xx/fs/etc/rc.d/vsp_pair
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
start()
 | 
			
		||||
{
 | 
			
		||||
    socat -d -d pty,raw,echo=0,link=/tmp/ttyV0 pty,raw,echo=0,link=/tmp/ttyV1 < /dev/null > /dev/null &
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
stop()
 | 
			
		||||
{
 | 
			
		||||
    while [ 1 ]; do
 | 
			
		||||
        echo "* Stopping process..."        
 | 
			
		||||
        killall socat > /dev/null 2>&1
 | 
			
		||||
 | 
			
		||||
       
 | 
			
		||||
        for r in 0 1 2 3 4 5 6 7 8 9; do
 | 
			
		||||
            if [ -n "$(pidof socat)" ]; then
 | 
			
		||||
                echo "* Waiting for process to exit ($r)..."
 | 
			
		||||
                sleep 1
 | 
			
		||||
            else
 | 
			
		||||
                echo "* Process not running."
 | 
			
		||||
                return 1
 | 
			
		||||
            fi
 | 
			
		||||
        done
 | 
			
		||||
 | 
			
		||||
        echo "* Forcing exit..."
 | 
			
		||||
        killall -9 socat > /dev/null 2>&1
 | 
			
		||||
        sleep 1
 | 
			
		||||
    done
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user