build.WPS_Functions.SYSTEM.PROCES.IS-ALIVE.xml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project basedir="../" name="WPS_Functions.SYSTEM.PROCES.IS-ALIVE" default="WPS_Functions.SYSTEM.PROCES.IS-ALIVE">
  3. <include file="build.WPS_Functions.PRODUCT.xml" optional="true"/>
  4. <property name="WPS_Functions.SYSTEM.PROCES.IS-ALIVE.build" location="${WPS_Functions.basedir}/build.WPS_Functions.SYSTEM.PROCES.IS-ALIVE.xml"/>
  5. <property name="WPS_Functions.SYSTEM.PROCES.IS-ALIVE.bash-script" location="${WPS_Functions.basedir}/WPS_Functions.SYSTEM.PROCES.IS-ALIVE.sh"/>
  6. <local name="WPS_Functions.SYSTEM.PROCES.IS-ALIVE.tested-process.is-alive"/>
  7. <local name="WPS_Functions.SYSTEM.PROCES.IS-ALIVE.tested-process"/>
  8. <local name="WPS_Functions.SYSTEM.PROCES.IS-ALIVE.tested-process.result"/>
  9. <local name="WPS_Functions.SYSTEM.PROCES.IS-ALIVE.tested-process.is-alive"/>
  10. <target name="WPS_Functions.SYSTEM.PROCES.IS-ALIVE" description="To if typed process is alive">
  11. <local name="WPS_Functions.SYSTEM.PROCES.IS-ALIVE.tested-process"/>
  12. <local name="WPS_Functions.SYSTEM.PROCES.IS-ALIVE.tested-process.result"/>
  13. <local name="WPS_Functions.SYSTEM.PROCES.IS-ALIVE.cond"/>
  14. <local name="WPS_Functions.SYSTEM.PROCES.IS-ALIVE.tested-process.is-alive"/>
  15. <input addproperty="WPS_Functions.SYSTEM.PROCES.IS-ALIVE.tested-process" message="Type process Process ID to check if it is alive"/>
  16. <exec executable="${WPS_Functions.SYSTEM.PROCES.IS-ALIVE.bash-script}"
  17. outputproperty="WPS_Functions.SYSTEM.PROCES.IS-ALIVE.tested-process.result"
  18. />
  19. <condition taskname="WPS_Functions.SYSTEM.PROCES.IS-ALIVE.cond" property="WPS_Functions.SYSTEM.PROCES.IS-ALIVE.tested-process.is-alive">
  20. <contains string="${WPS_Functions.SYSTEM.PROCES.IS-ALIVE.tested-process.result}"
  21. substring="ALIVE" />
  22. </condition>
  23. </target>
  24. <target name="WPS_Functions.SYSTEM.PROCES.IS-ALIVE.cond" depends="WPS_Functions.SYSTEM.PROCES.IS-ALIVE.ALIVE,WPS_Functions.SYSTEM.PROCES.IS-ALIVE.DEAD"/>
  25. <target name="WPS_Functions.SYSTEM.PROCES.IS-ALIVE.ALIVE" if="WPS_Functions.SYSTEM.PROCES.IS-ALIVE.tested-process.is-alive">
  26. <echo>Process ${WPS_Functions.SYSTEM.PROCES.IS-ALIVE.tested-process.is-alive} is ALIVE</echo>
  27. </target>
  28. <target name="WPS_Functions.SYSTEM.PROCES.IS-ALIVE.DEAD" unless="WPS_Functions.SYSTEM.PROCES.IS-ALIVE.tested-process.is-alive">
  29. <echo>Process ${WPS_Functions.SYSTEM.PROCES.IS-ALIVE.tested-process.is-alive} is DEAD</echo>
  30. </target>
  31. </project>