Skip to content
Snippets Groups Projects
Commit da2002e2 authored by Jameson Rollins's avatar Jameson Rollins
Browse files

install: remove creation of no longer needed start/stop scripts

parent 45ea83b8
No related branches found
No related tags found
1 merge request!98install script cleanup
......@@ -106,153 +106,6 @@ if test -e $TARGET/bin/${system}.rtl; then
echo sudo $TARGET/bin/${system}.rtl ' > '$TARGET/logs/log.txt ' 2>& 1 &' > $TARGET/scripts/startup${ifo}rt
chmod +x $TARGET/scripts/startup${ifo}rt
fi
echo Installing start and stop scripts
mkdir -p $RTCDS/scripts
touch $RTCDS/scripts/kill${system}
chmod +x $RTCDS/scripts/kill${system}
echo $RTCDS/scripts/kill${system}
cat > $RTCDS/scripts/kill${system} << EOF
#!/bin/bash
#
sudo killall ${system}
sudo killall ${system}epics
sudo /sbin/rmmod ${system} 2&>/dev/null
res=\`ps h -C awgtpman | grep "${system} "\`
if [ "x\${res}" != x ]; then
num=\$(echo \${res} | awk '{print \$1}')
sudo kill \$num
fi
EOF
echo $RTCDS/scripts/start${system}
touch $RTCDS/scripts/start${system}
chmod +x $RTCDS/scripts/start${system}
if [ ${rtflag} -eq 0 ];then
cat > $RTCDS/scripts/start${system} << EOF
#!/bin/bash
#
if [ \`hostname\` != '${hostname}' ]; then
echo Cannot run \`basename \$0\` on \`hostname\` computer
exit 1
fi
$RTCDS/scripts/kill${system}
sleep 5
(cd $TARGET/${system}epics && ./startup${ifo})
EOF
fi
if [ ${rtflag} -eq 1 ];then
cat > $RTCDS/scripts/start${system} << EOF
#!/bin/bash
#
if [ \`hostname\` != '${hostname}' ]; then
echo Cannot run \`basename \$0\` on \`hostname\` computer
exit 1
fi
$RTCDS/scripts/kill${system}
sleep 5
ADC_COUNT=\`lspci -v -n | grep 3101 | wc -l\`
DAC16_COUNT=\`lspci -v -n | grep 3120 | wc -l\`
DAC18_COUNT=\`lspci -v -n | grep 3357 | wc -l\`
DAC20_COUNT=\`lspci -v -n | grep 3574 | wc -l\`
echo Number of ADC cards on bus = \$ADC_COUNT
echo Number of DAC16 cards on bus = \$DAC16_COUNT
echo Number of DAC18 cards on bus = \$DAC18_COUNT
echo Number of DAC20 cards on bus = \$DAC20_COUNT
if (( \$ADC_COUNT < $adccount )); then
echo Cannot run: Expected $adccount ADC cards, but only found \$ADC_COUNT cards on bus
exit 1
fi
if (( \$DAC16_COUNT < $daccount16 )); then
echo Cannot run: Expected $daccount16 16bitDAC cards, but only found \$DAC16_COUNT cards on bus
exit 1
fi
if (( \$DAC18_COUNT < $daccount18 )); then
echo Cannot run: Expected $daccount18 16bitDAC cards, but only found \$DAC18 cards on bus
exit 1
fi
if (( \$DAC20_COUNT < $daccount20 )); then
echo Cannot run: Expected $daccount20 20bitDAC cards, but only found \$DAC20 cards on bus
exit 1
fi
(cd $TARGET/${system}epics && ./startup${ifo})
sleep 5
$TARGET/scripts/startup${ifo}rt
# wait until real-time is active
gpsbad=true
numsec=0
if (( $nodaq < 1)); then
while [ \$gpsbad = true ] && ((\$numsec < 80))
do
sleep 1
numsec=\$((\$numsec+1))
CPU=\$(caget -t $cpumeter)
if [ \$CPU \> 0 ]; then
echo '${system} RT ready in '\$numsec
gpsbad=false
fi
done
#
sudo killall -q daqd
if [ -e /var/run/init.d/awgtpman_${system} ]; then
sudo /var/run/init.d/awgtpman_${system} start
else
(cd $RTCDS/target/gds && ./awgtpman_startup/awgtpman_${system}.cmd)
fi
fi
touch $TARGET/logs/reboot.log
chmod 777 $TARGET/logs/reboot.log
EOF
fi
echo $RTCDS/scripts/start${system}_usp
touch $RTCDS/scripts/start${system}_usp
chmod +x $RTCDS/scripts/start${system}_usp
cat > $RTCDS/scripts/start${system}_usp << EOF
#!/bin/bash
#
if [ \`hostname\` != '${hostname}' ]; then
echo Cannot run \`basename \$0\` on \`hostname\` computer
exit 1
fi
$RTCDS/scripts/kill${system}
sleep 5
(cd $TARGET/${system}epics && ./startup${ifo})
sleep 5
$TARGET/scripts/startup${ifo}usp
sleep 10
if [ -e /var/run/init.d/awgtpman_${system} ]; then
sudo /var/run/init.d/awgtpman_${system} start
else
(cd $RTCDS/target/gds && ./awgtpman_startup/awgtpman_${system}.cmd)
fi
touch $TARGET/logs/reboot.log
chmod 777 $TARGET/logs/reboot.log
EOF
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment