Browse code

kamctl remove svn ID's and history

Olle E. Johansson authored on 03/06/2016 08:34:25
Showing 1 changed files
... ...
@@ -1,5 +1,4 @@
1 1
 #!/bin/sh
2
-# $Id$
3 2
 #
4 3
 # Script for common functions for Oracle engine in Kamailio
5 4
 #
Browse code

kamctl: moved from tools/ to utils/

- mv tools/kamctl utils/kamctl
- updated srdb1 Makefile and test/unit/include/common with the new
kamctl path

Andrei Pelinescu-Onciul authored on 09/10/2009 12:05:15
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,89 @@
1
+#!/bin/sh
2
+# $Id$
3
+#
4
+# Script for common functions for Oracle engine in Kamailio
5
+#
6
+# History:
7
+
8
+if [ -z "$EGREP" ]; then
9
+	EGREP="egrep"
10
+fi
11
+
12
+# read any password
13
+prompt_oracle_pw()
14
+{
15
+	case $1 in
16
+	    rw)
17
+		if [ -n "$DBRWPW" ]; then
18
+			return
19
+		fi
20
+		CURDBUSER="$DBRWUSER"
21
+		;;
22
+	    ro)
23
+		if [ -n "$DBROPW" ]; then
24
+			return
25
+		fi
26
+		CURDBUSER="$DBROUSER"
27
+		;;
28
+	    root)
29
+		if [ -n "$DBROOTPW" ]; then
30
+			return
31
+		fi
32
+		CURDBUSER="$DBROOTUSER"
33
+		;;
34
+	    sys)
35
+		if [ -n "$DBSYSPW" ]; then
36
+			return
37
+		fi
38
+		CURDBUSER="$DBSYSUSER"
39
+		;;
40
+	    *)
41
+		merr "prompt_oracle_pw: argument error"
42
+		exit 1
43
+		;;
44
+	esac
45
+	savetty=`stty -g`
46
+	echo -n "Oracle password for $CURDBUSER: "
47
+	stty -echo
48
+	case $1 in
49
+	    rw)
50
+		read DBRWPW
51
+		export DBRWPW
52
+		CURPW=$DBRWPW
53
+		;;
54
+	    ro)
55
+		read DBROPW
56
+		export DBROPW
57
+		CURPW=$DBROPW
58
+		;;
59
+	    root)
60
+		read DBROOTPW
61
+		export DBROOTPW
62
+		CURPW=$DBROOTPW
63
+		;;
64
+	    sys)
65
+		read DBSYSPW
66
+		export DBSYSPW
67
+		CURPW=$DBSYSPW
68
+		;;
69
+	esac
70
+	stty $savetty
71
+	echo
72
+	if [ -z "$CURPW" ]; then
73
+		merr "empty password is illegal"
74
+		exit 1
75
+	fi
76
+}
77
+
78
+check_oracle_log()
79
+{
80
+	if [ -f $ORALOG ]; then
81
+		$EGREP -qi "error" $ORALOG
82
+		if [ $? -eq 0 ]; then
83
+			echo "NOTE: last errors stored in $ORALOG"
84
+			return 0
85
+		fi
86
+		rm $ORALOG
87
+	fi
88
+	return 1
89
+}