0,0 → 1,256 |
#! /bin/sh /usr/share/dpatch/dpatch-run |
## bashisms.dpatch by Magnus Holmgren <holmgren@debian.org> |
## |
## DP: Replace non-POSIX `type' command with `which', kill -SIGNAL |
## DP: with kill -s SIGNAL and trap "final" 0 2 15 with trap "final" |
## DP: 0 INT TERM. |
|
@DPATCH@ |
diff -urNad trunk~/scripts/ssvnc trunk/scripts/ssvnc |
--- trunk~/scripts/ssvnc 2009-10-25 15:15:48.000000000 +0100 |
+++ trunk/scripts/ssvnc 2009-10-31 17:08:05.000000000 +0100 |
@@ -124,7 +124,7 @@ |
WISH=wish |
for try in wish8.4 wish wish8.3 wish8.5 wish8.6 |
do |
- if type $try > /dev/null; then |
+ if which $try > /dev/null; then |
WISH=$try |
break |
fi |
@@ -185,13 +185,13 @@ |
PATH=$PATH:/usr/sbin:/usr/local/sbin:/dist/sbin |
|
quit=0 |
- if type vncviewer >/dev/null 2>/dev/null; then |
+ if which vncviewer >/dev/null 2>/dev/null; then |
: |
else |
echo "vncviewer not found in PATH." |
quit=1 |
fi |
- if type stunnel >/dev/null 2>/dev/null; then |
+ if which stunnel >/dev/null 2>/dev/null; then |
: |
else |
echo "stunnel not found in PATH." |
diff -urNad trunk~/scripts/ssvnc_cmd trunk/scripts/ssvnc_cmd |
--- trunk~/scripts/ssvnc_cmd 2009-10-25 15:15:42.000000000 +0100 |
+++ trunk/scripts/ssvnc_cmd 2009-10-31 17:08:05.000000000 +0100 |
@@ -181,13 +181,13 @@ |
PATH=$PATH:/usr/sbin:/usr/local/sbin:/dist/sbin |
|
quit=0 |
- if type vncviewer >/dev/null 2>/dev/null; then |
+ if which vncviewer >/dev/null 2>/dev/null; then |
: |
else |
echo "vncviewer not found in PATH." |
quit=1 |
fi |
- if type stunnel >/dev/null 2>/dev/null; then |
+ if which stunnel >/dev/null 2>/dev/null; then |
: |
else |
echo "stunnel not found in PATH." |
@@ -254,7 +254,7 @@ |
if echo "$VNCVIEWERCMD" | grep '\.turbovnc' > /dev/null; then |
: |
else |
- if type "$VNCVIEWERCMD.turbovnc" > /dev/null 2>/dev/null; then |
+ if which "$VNCVIEWERCMD.turbovnc" > /dev/null 2>/dev/null; then |
VNCVIEWERCMD="$VNCVIEWERCMD.turbovnc" |
fi |
fi |
diff -urNad trunk~/scripts/util/ss_vncviewer trunk/scripts/util/ss_vncviewer |
--- trunk~/scripts/util/ss_vncviewer 2009-10-28 15:21:49.000000000 +0100 |
+++ trunk/scripts/util/ss_vncviewer 2009-10-31 17:22:43.000000000 +0100 |
@@ -119,7 +119,7 @@ |
if echo "$VNCVIEWERCMD" | grep '\.turbovnc' > /dev/null; then |
: |
else |
- if type "$VNCVIEWERCMD.turbovnc" > /dev/null 2>/dev/null; then |
+ if which "$VNCVIEWERCMD.turbovnc" > /dev/null 2>/dev/null; then |
VNCVIEWERCMD="$VNCVIEWERCMD.turbovnc" |
fi |
fi |
@@ -146,7 +146,7 @@ |
check_stunnel=1 |
if [ "X$SSVNC_BASEDIRNAME" != "X" ]; then |
if [ -x "$SSVNC_BASEDIRNAME/stunnel" ]; then |
- type stunnel > /dev/null 2>&1 |
+ which stunnel > /dev/null 2>&1 |
if [ $? = 0 ]; then |
# found ours |
STUNNEL=stunnel |
@@ -155,7 +155,7 @@ |
fi |
fi |
if [ "X$check_stunnel" = "X1" ]; then |
- type stunnel4 > /dev/null 2>&1 |
+ which stunnel4 > /dev/null 2>&1 |
if [ $? = 0 ]; then |
STUNNEL=stunnel4 |
else |
@@ -395,7 +395,7 @@ |
# a portable, but not absolutely safe, tmp file creator |
mytmp() { |
tf=$1 |
- if type mktemp > /dev/null 2>&1; then |
+ if which mktemp > /dev/null 2>&1; then |
# if we have mktemp(1), use it: |
tf2="$tf.XXXXXX" |
tf2=`mktemp "$tf2"` |
@@ -640,33 +640,33 @@ |
fi |
if [ "X$pssh" != "X" ]; then |
echo "Terminating background ssh process" |
- echo kill -TERM "$pssh" |
- kill -TERM "$pssh" 2>/dev/null |
+ echo kill -s TERM "$pssh" |
+ kill -s TERM "$pssh" 2>/dev/null |
sleep 1 |
- kill -KILL "$pssh" 2>/dev/null |
+ kill -s KILL "$pssh" 2>/dev/null |
pssh="" |
fi |
if [ "X$stunnel_pid" != "X" ]; then |
echo "Terminating background stunnel process" |
- echo kill -TERM "$stunnel_pid" |
- kill -TERM "$stunnel_pid" 2>/dev/null |
+ echo kill -s TERM "$stunnel_pid" |
+ kill -s TERM "$stunnel_pid" 2>/dev/null |
sleep 1 |
- kill -KILL "$stunnel_pid" 2>/dev/null |
+ kill -s KILL "$stunnel_pid" 2>/dev/null |
stunnel_pid="" |
fi |
if [ "X$dsm_pid" != "X" ]; then |
echo "Terminating background ultravnc_dsm_helper process" |
- echo kill -TERM "$dsm_pid" |
- kill -TERM "$dsm_pid" 2>/dev/null |
+ echo kill -s TERM "$dsm_pid" |
+ kill -s TERM "$dsm_pid" 2>/dev/null |
sleep 1 |
- kill -KILL "$dsm_pid" 2>/dev/null |
+ kill -s KILL "$dsm_pid" 2>/dev/null |
stunnel_pid="" |
fi |
if [ "X$tail_pid" != "X" ]; then |
- kill -TERM $tail_pid |
+ kill -s TERM $tail_pid |
fi |
if [ "X$tail_pid2" != "X" ]; then |
- kill -TERM $tail_pid2 |
+ kill -s TERM $tail_pid2 |
fi |
} |
|
@@ -721,7 +721,7 @@ |
|
# trick for the undocumented rsh://host:port method. |
rsh_viewer() { |
- trap "final" 0 2 15 |
+ trap "final" 0 INT TERM |
if [ "X$PORT" = "X" ]; then |
exit 1 |
elif [ $PORT -ge 5900 ]; then |
@@ -740,7 +740,7 @@ |
} |
|
check_perl() { |
- if type "$1" > /dev/null 2>&1; then |
+ if which "$1" > /dev/null 2>&1; then |
: |
elif [ ! -x "$1" ]; then |
echo "" |
@@ -2036,7 +2036,7 @@ |
if [ "X$sshword" != "X" ]; then |
if [ -x "$sshword" ]; then |
: |
- elif type "$sshword" > /dev/null 2>&1; then |
+ elif which "$sshword" > /dev/null 2>&1; then |
: |
else |
echo "" |
@@ -2343,7 +2343,7 @@ |
|
stty sane |
i=0 |
- if type perl > /dev/null 2>&1; then |
+ if which perl > /dev/null 2>&1; then |
imax=50 |
sleepit="perl -e 'select(undef, undef, undef, 0.20)'" |
else |
@@ -2458,7 +2458,7 @@ |
if [ "X$use_sshssl" = "X" -a "X$getport" = "X" ]; then |
echo "Running viewer:" |
|
- trap "final" 0 2 15 |
+ trap "final" 0 INT TERM |
if [ "X$reverse" = "X" ]; then |
echo "$VNCVIEWERCMD" "$@" $localhost:$N |
echo "" |
@@ -2515,7 +2515,7 @@ |
fi |
|
if [ "X$stunnel_set_here" = "X1" -a "X$showcert" = "X" ]; then |
- if type $STUNNEL > /dev/null 2>&1; then |
+ if which $STUNNEL > /dev/null 2>&1; then |
: |
else |
echo "" |
@@ -2624,7 +2624,7 @@ |
if [ "X$ciphers" != "X" ]; then |
cipher_args=`echo "$ciphers" | sed -e 's/ciphers=/-cipher /'` |
fi |
- if type openssl > /dev/null 2>&1; then |
+ if which openssl > /dev/null 2>&1; then |
: |
else |
echo "" |
@@ -2735,7 +2735,7 @@ |
if [ "X$getport" = "X" ]; then |
sleep 1 |
fi |
- elif type printf > /dev/null 2>&1; then |
+ elif which printf > /dev/null 2>&1; then |
printf "Are you sure you want to continue? [y]/n " |
read x |
else |
@@ -2798,7 +2798,7 @@ |
fi |
hostdisp2=`echo "$hostdisp" | sed -e 's/pw=[^ ]*/pw=******/g'` |
echo "$VNCVIEWERCMD" "$@" "$hostdisp2" |
- trap "final" 0 2 15 |
+ trap "final" 0 INT TERM |
echo "" |
$VNCVIEWERCMD "$@" "$hostdisp" |
if [ $? != 0 ]; then |
@@ -2812,7 +2812,7 @@ |
echo "" |
echo "NOTE: Press Ctrl-C to terminate viewer LISTEN mode." |
echo "" |
- trap "final" 0 2 15 |
+ trap "final" 0 INT TERM |
if [ "X$SSVNC_ULTRA_DSM" != "X" ]; then |
echo "NOTE: The ultravnc_dsm_helper only runs once. So after the first LISTEN" |
echo " ends, you may have to Press Ctrl-C and restart for another connection." |
@@ -3004,7 +3004,7 @@ |
vnc_hp="exec=$STUNNEL $tmp_cfg" |
fi |
echo "$VNCVIEWERCMD" "$@" "$vnc_hp" |
- trap "final" 0 2 15 |
+ trap "final" 0 INT TERM |
echo "" |
$VNCVIEWERCMD "$@" "$vnc_hp" |
if [ $? != 0 ]; then |
@@ -3019,7 +3019,7 @@ |
echo "" |
echo "NOTE: Press Ctrl-C to terminate viewer LISTEN mode." |
echo "" |
- trap "final" 0 2 15 |
+ trap "final" 0 INT TERM |
N2=$N |
N2_trim=`echo "$N2" | sed -e 's/://g'` |
if [ $N2_trim -le 200 ]; then |
Property changes: |
Added: svn:executable |
## -0,0 +1 ## |
+* |
\ No newline at end of property |