upgrade-1.4_to_1.7.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/sh
  2. export INSTALLOG=/tmp/sn-install
  3. export INSTALLPATH=/opt/secretnet/
  4. export SN_SNAIDE=$INSTALLPATH/bin/snaide
  5. export CMD_mv=/bin/mv
  6. export CMD_chmod=/bin/chmod
  7. if [ -z "$1" ]; then
  8. echo "The update is not performed. You must specify the installation package SecretNet LSP..." 1>/tmp/sn-update.log 2>&1
  9. exit 1
  10. fi
  11. SN_VERSION="1.4"
  12. sed s/SecretNet\ LSP\ version.*/Secret\ Net\ LSP\ $SN_VERSION/ -i /opt/secretnet/etc/secretnet-release
  13. SN_RH5_GRUB_PATCH=" selinux=0 vdso=0"
  14. SN_RH6_GRUB_PATCH=" security=default"
  15. grep -q $SN_RH5_GRUB_PATCH /boot/grub/grub.conf 2>/dev/null
  16. if [ $? = "0" ] ; then
  17. sed -i "s/$SN_RH5_GRUB_PATCH//g" /boot/grub/grub.conf
  18. fi
  19. grep -q $SN_RH6_GRUB_PATCH /boot/grub/grub.conf 2>/dev/null
  20. if [ $? = "0" ] ; then
  21. sed -i "s/$SN_RH6_GRUB_PATCH//g" /boot/grub/grub.conf
  22. fi
  23. if [ -e /etc/inittab.bak ] ; then
  24. /bin/cp -f /etc/inittab.bak /opt/secretnet/var/install/save-config/etc/inittab
  25. fi
  26. if [ -e /etc/init/prefdm.conf ] ; then
  27. chattr -i /etc/init/prefdm.conf 2>/dev/null
  28. mv /etc/init/prefdm.conf.bak /etc/init/prefdm.conf 2>/dev/null
  29. fi
  30. rpm -Uvh $1
  31. echo "$(uname -r)" > $INSTALLPATH/etc/kernel-name