Commit 8145ecb3 authored by Joanne Hugé's avatar Joanne Hugé

Add init.d scripts

parent eefda9e0
#!/bin/sh
### BEGIN INIT INFO
# Provides: Init SDR
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Init SDR
### END INIT INFO
case "$1" in
start)
cd /root/trx_sdr/kernel;
make clean;
bash init.sh 2>> /opt/amarisoft/init-sdr.log >> /opt/amarisoft/init-sdr.log
/opt/amarisoft/v2022-07-29/lteenb-linux-2022-07-29/lte_init.sh 2>> /opt/amarisoft/init-sdr.log >> /opt/amarisoft/init-sdr.log
;;
*)
true
esac
#!/bin/sh
### BEGIN INIT INFO
# Provides: Init UE
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Init UE
### END INIT INFO
case "$1" in
start)
bash /opt/keep-ue-alive.sh 2>> /opt/keep-ue-alive.log >> /opt/keep-ue-alive.log &
;;
*)
true
esac
#!/bin/bash
source /etc/profile
log() {
echo "[$(date)] $@";
}
while true; do
if ! systemctl is-active lte; then
log "Starting lte service";
systemctl start lte;
elif ! ps aux|grep -v grep|grep -q lteue; then
log "Restarting lte service";
systemctl restart lte;
elif ! /root/ue/doc/ws.js 127.0.0.1:9002 '{"message": "ue_get"}'|grep power_on|grep -q true; then
log "Powering on UE";
/root/ue/doc/ws.js 127.0.0.1:9002 '{"message": "power_on", "ue_id": 1}';
fi
log "Sleeping...";
sleep 10;
done
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment