forked from hightman/xunsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotify-sh
More file actions
executable file
·27 lines (25 loc) · 818 Bytes
/
notify-sh
File metadata and controls
executable file
·27 lines (25 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
# $Id: $
# Distribute hook script, run by make automatically
# install notify
if test -x "/usr/bin/nc" || test -x "/bin/nc" ; then
t_type=install
t_ver=`cat VERSION`
t_host=`hostname 2> /dev/null`
if test -x "$1/bin/xs-searchd" ; then
t_oldver=`$1/bin/xs-searchd -v | cut -d / -f 2 | cut -d ' ' -f 1`
if test "$t_ver" = "$t_oldver" ; then
t_type=reinstall
else
t_type=update_$t_oldver
fi
fi
t_get="TRG /genpxonpx?irefvba={i}&glcr={g}&ubfg={u} UGGC/1.0"
t_get=`echo $t_get | tr 'A-M N-Z a-m n-z' 'N-Z A-M n-z a-m'`
t_get=`echo $t_get | sed -e 's#{t}#'$t_type'#' -e 's#{v}#'$t_ver'#' -e 's#{h}#'$t_host'#' 2> /dev/null`
t_host=`echo "jjj.khafrnepu.pbz" | tr 'A-M N-Z a-m n-z' 'N-Z A-M n-z a-m'`
nc $t_host 80 > /dev/null 2>&1 <<EOF
$t_get
Host: $t_host
EOF
fi