Compare commits

...

6 Commits

6 changed files with 55 additions and 11 deletions

3
Makefile Normal file
View File

@ -0,0 +1,3 @@
fns=diralias j jmod lr tcat
install:
install ${fns} $${FPATH:?FPATH not defined}

View File

@ -1,5 +1,4 @@
#!/bin/ksh
diralias()
function diralias
{
typeset -i i
case $# in
@ -13,15 +12,15 @@ diralias()
;;
1)
let i=0
while [[ i -lt ${#DIRALIASNAM[@]} && $1 != ${DIRALIASNAM[i]} ]]
while [[ $i -lt ${#DIRALIASNAM[@]} && $1 != ${DIRALIASNAM[i]} ]]
do
let i++
done
(( i == ${#DIRALIASNAM[@]} )) && echo $1 || echo ${DIRALIASVAL[i]}
(( i == ${#DIRALIASNAM[@]} )) && print $1 || print ${DIRALIASVAL[i]}
;;
2)
let i=0
while [[ i -lt ${#DIRALIASNAM[@]} && $1 != ${DIRALIASNAM[i]} ]]
while [[ $i -lt ${#DIRALIASNAM[@]} && $1 != ${DIRALIASNAM[i]} ]]
do
let i++
done

9
j
View File

@ -1,11 +1,10 @@
#!/bin/ksh
j()
function j
{
local da
typeset da
da=$(diralias $1)
if echo $da | grep '^!' >/dev/null
if print $da | grep '^!' >/dev/null
then
if ! da=$(eval $(echo "$da" | sed 's/^!//') 2>/dev/null)
if ! da=$(eval $(print "$da" | sed 's/^!//') 2>/dev/null)
then
return 65
fi

15
jmod Normal file
View File

@ -0,0 +1,15 @@
function jmod
{
(( $# != 1 )) && return 64
typeset m=$(jr && pwd)/modules/apps
typeset d=$(find $m -maxdepth 2 -mindepth 2 -type d -iregex ".*/.*$1$")
[[ -z $d ]] && return 1
if (( $(print $d | wc -w) > 1 ))
then
select d in $d
do
break
done
fi
print ${d##*/} && cd $d
}

10
lr
View File

@ -6,7 +6,15 @@ function lr
(jr && ant all)
;;
bl)
(jr && modules/apps/portal-language/portal-language-all && gw buildLang)
(jr && cd modules/apps/portal-language/portal-language-lang && gw buildLang)
;;
kill)
pkill -9 -f Liferay
psql -c 'drop schema ce cascade;' -c 'create schema authorization ce;' postgres postgres
(jr && rm -rf ../bundles/data && rm -rf ../bundles/osgi/state)
;;
killdaemon)
pkill -9 -f gradle
;;
sf|fs)
(jr && cd portal-impl && ant format-source)

20
tcat Normal file
View File

@ -0,0 +1,20 @@
function tcat
{
(( $# != 1 )) && return 64
case $1 in
log)
(jr && less ../bundles/tomcat-*/logs/catalina.out)
;;
start)
pgrep -f tomcat && return 1
(jr && ../bundles/tomcat-*/bin/catalina.sh jpda start) >/dev/null
;;
stop)
pgrep -f tomcat || return 1
(jr && ../bundles/tomcat-*/bin/shutdown.sh) >/dev/null
;;
*)
return 64
;;
esac
}