BTS management:
Add a noupdate option to the opkg script to try updating the packages without actually running an update (maybe we already have the latest lists) Tweak the maint and timing for it to temporarily push fixed manager binary. In opkg-1, install on BTS0 in order to download the packages before copying them to the local system.
This commit is contained in:
parent
ccb89949ec
commit
6a88c29144
5 changed files with 25 additions and 12 deletions
|
@ -44,13 +44,18 @@ for bts in "${!BTS[@]}" ; do
|
|||
# Nothing to do
|
||||
fi
|
||||
|
||||
if [ "$_trxNR" == "0" ] ; then
|
||||
|
||||
if [ "$_modelNR" == "2050" ] && [ "$_trxNR" == "0" ] ; then
|
||||
# Master Verified.
|
||||
echo "BTS is a 2050 Master"
|
||||
scp $SSH_OPTS mgr root@${BTS[$bts]}:/bin/
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "chmod 750 /bin/mgr"
|
||||
gunzip -c sysmobts-mgr-arm.gz > sysmobts-mgr
|
||||
scp $SSH_OPTS sysmobts-mgr root@${BTS[$bts]}:/usr/bin/
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "chmod 755 /usr/bin/sysmobts-mgr ; systemctl restart sysmobts-mgr"
|
||||
# things to do
|
||||
scp $SSH_OPTS rc.local root@${BTS[$bts]}:/etc/rc.local
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "chmod 750 /etc/rc.local"
|
||||
|
||||
fi
|
||||
|
||||
if [ "$_trxNR" == "1" ] ; then
|
||||
|
|
|
@ -25,25 +25,26 @@ for bts in "${!BTS[@]}" ; do
|
|||
if [ $bts == 0 ]; then
|
||||
scp $SSH_OPTS base-feeds-nightly.conf root@${BTS[$bts]}:/etc/opkg/base-feeds.conf
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin opkg clean; opkg update"
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin opkg install osmo-bts osmo-pcu sysmobts-util ntp ipaccess-utils osmo-bts-remote"
|
||||
scp $SSH_OPTS -r root@${BTS[$bts]}:/var/lib/opkg/* opkg
|
||||
scp $SSH_OPTS -r root@${BTS[$bts]}:/var/cache/opkg/* opkg/cache
|
||||
fi
|
||||
if [ $bts != 0 ] ; then
|
||||
scp $SSH_OPTS -r opkg/* root@${BTS[$bts]}:/var/lib/opkg/
|
||||
scp $SSH_OPTS -r opkg/cache/* root@${BTS[$bts]}:/var/cache/opkg/
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin opkg install osmo-bts osmo-pcu sysmobts-util ntp ipaccess-utils osmo-bts-remote"
|
||||
fi
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin opkg install osmo-bts osmo-pcu sysmobts-util ntp ipaccess-utils osmo-bts-remote"
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin opkg remove libosmoabis6 libosmogsm13 libosmovty3 libosmovty4"
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "systemctl enable osmo-pcu; systemctl start osmo-pcu"
|
||||
|
||||
fi
|
||||
|
||||
if [ "$(ssh $SSH_OPTS ${BTS[$bts]} 'ls /usr/bin/osmo-bts-sysmo-nitb 2> /dev/null; echo $?')" == "2" ] ; then
|
||||
#if [ "$(ssh $SSH_OPTS ${BTS[$bts]} 'ls /usr/bin/osmo-bts-sysmo-nitb 2> /dev/null; echo $?')" == "2" ] ; then
|
||||
gunzip -c osmo-bts-sysmo-arm-cf7a.gz > osmo-bts-sysmo-nitb
|
||||
scp $SSH_OPTS osmo-bts-sysmo-nitb root@${BTS[$bts]}:/usr/bin/
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "chmod 755 /usr/bin/osmo-bts-sysmo-nitb"
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "cd /usr/bin; mv osmo-bts-sysmo osmo-bts-sysmo.opkg ; ln -s osmo-bts-sysmo-nitb osmo-bts-sysmo"
|
||||
fi
|
||||
#fi
|
||||
#if [ "$(ssh $SSH_OPTS ${BTS[$bts]} 'ls /usr/bin/osmo-pcu-nitb 2> /dev/null; echo $?')" == "2" ] ; then
|
||||
gunzip -c osmo-pcu-arm-54211.gz > osmo-pcu-nitb
|
||||
scp $SSH_OPTS osmo-pcu-nitb root@${BTS[$bts]}:/usr/bin/
|
||||
|
|
|
@ -13,24 +13,31 @@ SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/tmp/known-$RANDOM"
|
|||
for bts in "${!BTS[@]}" ; do
|
||||
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "systemctl restart gpsdate"
|
||||
_modelNR=$(ssh $SSH_OPTS ${BTS[$bts]} sysmobts-util model-nr)
|
||||
_trxNR=$(ssh $SSH_OPTS ${BTS[$bts]} sysmobts-util trx-nr)
|
||||
|
||||
if [ "$(ssh $SSH_OPTS ${BTS[$bts]} 'grep 201705 /etc/opkg/base-feeds.conf >/dev/null; echo $?')" == "0" ] ; then
|
||||
|
||||
grep OPKG_CREDS base-feeds-nightly.conf > /dev/null
|
||||
if [ "$?" == "0" ]; then
|
||||
sed -i s/OPKG_CREDS/$OPKG_CREDS/g base-feeds-nightly.conf
|
||||
fi
|
||||
scp $SSH_OPTS base-feeds-nightly.conf root@${BTS[$bts]}:/etc/opkg/base-feeds.conf
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin opkg update; opkg install osmo-bts osmo-pcu sysmobts-util ntp ipaccess-utils osmo-bts-remote"
|
||||
if [ "$1" != "noupdate" ] ; then
|
||||
scp $SSH_OPTS base-feeds-nightly.conf root@${BTS[$bts]}:/etc/opkg/base-feeds.conf
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin opkg update"
|
||||
fi
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin opkg install osmo-bts osmo-pcu sysmobts-util ntp ipaccess-utils osmo-bts-remote"
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin opkg remove libosmoabis6 libosmogsm13 libosmovty3 libosmovty4"
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "systemctl enable osmo-pcu; systemctl start osmo-pcu"
|
||||
|
||||
fi
|
||||
|
||||
if [ "$(ssh $SSH_OPTS ${BTS[$bts]} 'ls /usr/bin/osmo-bts-sysmo-nitb 2> /dev/null; echo $?')" == "2" ] ; then
|
||||
#if [ "$(ssh $SSH_OPTS ${BTS[$bts]} 'ls /usr/bin/osmo-bts-sysmo-nitb 2> /dev/null; echo $?')" == "2" ] ; then
|
||||
gunzip -c osmo-bts-sysmo-arm-cf7a.gz > osmo-bts-sysmo-nitb
|
||||
scp $SSH_OPTS osmo-bts-sysmo-nitb root@${BTS[$bts]}:/usr/bin/
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "chmod 755 /usr/bin/osmo-bts-sysmo-nitb"
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "cd /usr/bin; mv osmo-bts-sysmo osmo-bts-sysmo.opkg ; ln -s osmo-bts-sysmo-nitb osmo-bts-sysmo"
|
||||
fi
|
||||
#fi
|
||||
#if [ "$(ssh $SSH_OPTS ${BTS[$bts]} 'ls /usr/bin/osmo-pcu-nitb 2> /dev/null; echo $?')" == "2" ] ; then
|
||||
gunzip -c osmo-pcu-arm-54211.gz > osmo-pcu-nitb
|
||||
scp $SSH_OPTS osmo-pcu-nitb root@${BTS[$bts]}:/usr/bin/
|
||||
|
|
|
@ -24,8 +24,8 @@ for bts in "${!BTS[@]}" ; do
|
|||
ssh $SSH_OPTS root@${BTS[$bts]} "echo nameserver 1.1.1.1 > /etc/resolv.conf; echo nameserver 9.9.9.9 >> /etc/resolv.conf"
|
||||
scp $SSH_OPTS osmo-pcu.cfg root@${BTS[$bts]}:/etc/osmocom/osmo-pcu.cfg
|
||||
scp $SSH_OPTS osmo-bts_$bts.cfg root@${BTS[$bts]}:/etc/osmocom/osmo-bts-sysmo.cfg
|
||||
scp $SSH_OPTS pcu bts root@${BTS[$bts]}:/bin/
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "chmod 750 /bin/pcu /bin/bts"
|
||||
scp $SSH_OPTS pcu bts mgr root@${BTS[$bts]}:/bin/
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "chmod 750 /bin/pcu /bin/bts /bin/mgr"
|
||||
ssh $SSH_OPTS root@${BTS[$bts]} "expect -v 2>/dev/null"
|
||||
|
||||
if [ "$?" != "0" ]; then
|
||||
|
|
|
@ -81,7 +81,7 @@ PYTHONPATH=$PYTHONPATH:/var/rhizomatica/rccn
|
|||
30 5 * * * root /home/rhizomatica/bin/check_broken.sh
|
||||
|
||||
# Jobs to run on the BTS
|
||||
15 3 * * * root /var/SysmoBTS/maint.sh
|
||||
*/15 * * * * root /var/SysmoBTS/maint.sh
|
||||
|
||||
# Check if FS or NTIB needs restart
|
||||
30 2-5 * * * root /home/rhizomatica/bin/check_dirty.sh
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue