#!/bin/bash
+VERSION="3.0"
KILL=/usr/bin/killall
MANAGER=/usr/bin/da_manager
-EVENT=/usr/bin/da_event
FIND=/usr/bin/find
GETAPPINSTALLPATH="/usr/bin/pkgcmd -a"
PORTFILE=/tmp/port.da
+READLINK=/usr/bin/readlink
print_usage()
{
echo "killmanager terminate da_manager"
# echo "killapp apppath terminate application"
echo "runmanager execute da_manager"
- echo "runevent record|play execute da_event"
echo "findunittest find unittest project"
+ echo "getversion get version"
+ echo "readlink filepath get value of given symbolic link or canonical file name"
}
kill_manager()
$MANAGER
}
-run_event()
-{
- case "$EVENTOPTION" in
- record)
- EVENTMODE="-r"
- ;;
- play)
- EVENTMODE="-s"
- ;;
- *)
- echo "Invalid event option!"
- print_usage
- exit 1
- ;;
- esac
-
- $EVENT $EVENTMODE
-}
-
find_unittest()
{
$FIND `$GETAPPINSTALLPATH | awk '{if (FNR==1) printf $NF}'` -name *.unittest
ps -eo pid,cmd
}
+get_version()
+{
+ echo $VERSION
+}
+
+read_link()
+{
+ $READLINK -f $FILEPATH
+}
if test $# -gt 2 -o $# -lt 1; then
print_usage
if test -n "$2"; then
case "$1" in
- runevent)
- EVENTOPTION=$2
- ;;
# killapp)
# APPPATH=$2
# ;;
+ readlink)
+ FILEPATH=$2
+ ;;
*)
print_usage
exit 1
runmanager)
run_manager
;;
- runevent)
- run_event
- ;;
findunittest)
find_unittest
;;
process)
process_list
;;
+ getversion)
+ get_version
+ ;;
+ readlink)
+ read_link
+ ;;
*)
echo "Unknown option!"
print_usage