123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- #!/bin/sh
- export basedir=/home/syjy/ipfcstV3
- chmod 777 $basedir/*
- chmod -R 777 $basedir/bin
- chmod -R 777 $basedir/settings
- chmod -R 777 $basedir/jdk
- chmod -R 777 $basedir/produce
- 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
- chmod 777 /usr/lib/systemd/system/monitor.service
- chmod 777 /usr/lib/systemd/system/console.service
- chmod 777 /usr/lib/systemd/system/reportquery.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
- chmod 777 /lib/systemd/system/monitor.service
- chmod 777 /lib/systemd/system/console.service
- chmod 777 /lib/systemd/system/reportquery.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/
- chmod 777 /etc/init.d/monitor
- chmod 777 /etc/init.d/console
- chmod 777 /etc/init.d/reportquery
- 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 list-unit-files --type=service | egrep "^console\.|^monitor\.|^reportquery\."
- systemctl restart monitor
- systemctl restart console
- systemctl restart reportquery
- else
- echo "initialize sysV"
- if [[ -n $(chkconfig --version 2>/dev/null) ]]; then
- chkconfig monitor on
- chkconfig console on
- chkconfig reportquery on
- chkconfig --list | egrep "^console\s|^monitor\s|^reportquery\s"
- else
- update-rc.d monitor defaults
- update-rc.d console defaults
- update-rc.d reportquery defaults
- fi
- service monitor restart
- service console restart
- service reportquery restart
- fi
- echo "Installation is complete!"
|