12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- #!/bin/sh
- export basedir=/home/syjy/ipfcstV3
- chmod -R 777 $basedir
- cd $basedir/jdk
- echo "Install jdk8!"
- tar -zxvf jdk-8u261-linux-x64.tar.gz
- if test -e /home/syjy/patch.zip;then
- cd /home/syjy
- unzip -o patch.zip
- fi
- if test -x /usr/lib/systemd/system;then
- cp -f $basedir/settings/monitor.service /usr/lib/systemd/system
- cp -f $basedir/settings/console.service /usr/lib/systemd/system
- cp -f $basedir/settings/reportquery.service /usr/lib/systemd/system
- cp -f $basedir/settings/cdq.service /usr/lib/systemd/system
- chmod 777 /usr/lib/systemd/system/monitor.service
- chmod 777 /usr/lib/systemd/system/console.service
- chmod 777 /usr/lib/systemd/system/reportquery.service
- chmod 777 /usr/lib/systemd/system/cdq.service
- fi
- if test -x /lib/systemd/system;then
- cp -f $basedir/settings/monitor.service /lib/systemd/system
- cp -f $basedir/settings/console.service /lib/systemd/system
- cp -f $basedir/settings/reportquery.service /lib/systemd/system
- cp -f $basedir/settings/cdq.service /lib/systemd/system
- chmod 777 /lib/systemd/system/monitor.service
- chmod 777 /lib/systemd/system/console.service
- chmod 777 /lib/systemd/system/reportquery.service
- chmod 777 /lib/systemd/system/cdq.service
- fi
- if test -x /etc/init.d;then
- cp -f $basedir/settings/monitor /etc/init.d/
- cp -f $basedir/settings/console /etc/init.d/
- cp -f $basedir/settings/reportquery /etc/init.d/
- cp -f $basedir/settings/cdq /etc/init.d/
- chmod 777 /etc/init.d/monitor
- chmod 777 /etc/init.d/console
- chmod 777 /etc/init.d/reportquery
- chmod 777 /etc/init.d/cdq
- fi
- if [[ -n `systemctl --version 2> /dev/null | grep systemd` ]];then
- echo "initialize systemd"
- systemctl daemon-reload
- systemctl enable monitor
- systemctl enable console
- systemctl enable reportquery
- systemctl enable cdq
- systemctl list-unit-files --type=service | egrep "^console\.|^monitor\.|^reportquery\.|^cdq\."
- systemctl restart monitor
- systemctl restart console
- systemctl restart reportquery
- systemctl restart cdq
- else
- echo "initialize sysV"
- if [[ -n `chkconfig --version 2> /dev/null` ]];then
- chkconfig monitor on
- chkconfig console on
- chkconfig reportquery on
- chkconfig cdq on
- chkconfig --list | egrep "^console\s|^monitor\s|^reportquery\s|^cdq\s"
- else
- update-rc.d monitor defaults
- update-rc.d console defaults
- update-rc.d reportquery defaults
- update-rc.d cdq defaults
- fi
- service monitor restart
- service console restart
- service reportquery restart
- service cdq restart
- fi
- echo "Installation is complete!"
|