Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#! /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=wishfor try in wish8.4 wish wish8.3 wish8.5 wish8.6do- if type $try > /dev/null; then+ if which $try > /dev/null; thenWISH=$trybreakfi@@ -185,13 +185,13 @@PATH=$PATH:/usr/sbin:/usr/local/sbin:/dist/sbinquit=0- if type vncviewer >/dev/null 2>/dev/null; then+ if which vncviewer >/dev/null 2>/dev/null; then:elseecho "vncviewer not found in PATH."quit=1fi- if type stunnel >/dev/null 2>/dev/null; then+ if which stunnel >/dev/null 2>/dev/null; then:elseecho "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/sbinquit=0- if type vncviewer >/dev/null 2>/dev/null; then+ if which vncviewer >/dev/null 2>/dev/null; then:elseecho "vncviewer not found in PATH."quit=1fi- if type stunnel >/dev/null 2>/dev/null; then+ if which stunnel >/dev/null 2>/dev/null; then:elseecho "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; thenVNCVIEWERCMD="$VNCVIEWERCMD.turbovnc"fifidiff -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; thenVNCVIEWERCMD="$VNCVIEWERCMD.turbovnc"fifi@@ -146,7 +146,7 @@check_stunnel=1if [ "X$SSVNC_BASEDIRNAME" != "X" ]; thenif [ -x "$SSVNC_BASEDIRNAME/stunnel" ]; then- type stunnel > /dev/null 2>&1+ which stunnel > /dev/null 2>&1if [ $? = 0 ]; then# found oursSTUNNEL=stunnel@@ -155,7 +155,7 @@fifiif [ "X$check_stunnel" = "X1" ]; then- type stunnel4 > /dev/null 2>&1+ which stunnel4 > /dev/null 2>&1if [ $? = 0 ]; thenSTUNNEL=stunnel4else@@ -395,7 +395,7 @@# a portable, but not absolutely safe, tmp file creatormytmp() {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 @@fiif [ "X$pssh" != "X" ]; thenecho "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/nullsleep 1- kill -KILL "$pssh" 2>/dev/null+ kill -s KILL "$pssh" 2>/dev/nullpssh=""fiif [ "X$stunnel_pid" != "X" ]; thenecho "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/nullsleep 1- kill -KILL "$stunnel_pid" 2>/dev/null+ kill -s KILL "$stunnel_pid" 2>/dev/nullstunnel_pid=""fiif [ "X$dsm_pid" != "X" ]; thenecho "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/nullsleep 1- kill -KILL "$dsm_pid" 2>/dev/null+ kill -s KILL "$dsm_pid" 2>/dev/nullstunnel_pid=""fiif [ "X$tail_pid" != "X" ]; then- kill -TERM $tail_pid+ kill -s TERM $tail_pidfiif [ "X$tail_pid2" != "X" ]; then- kill -TERM $tail_pid2+ kill -s TERM $tail_pid2fi}@@ -721,7 +721,7 @@# trick for the undocumented rsh://host:port method.rsh_viewer() {- trap "final" 0 2 15+ trap "final" 0 INT TERMif [ "X$PORT" = "X" ]; thenexit 1elif [ $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" ]; thenecho ""@@ -2036,7 +2036,7 @@if [ "X$sshword" != "X" ]; thenif [ -x "$sshword" ]; then:- elif type "$sshword" > /dev/null 2>&1; then+ elif which "$sshword" > /dev/null 2>&1; then:elseecho ""@@ -2343,7 +2343,7 @@stty sanei=0- if type perl > /dev/null 2>&1; then+ if which perl > /dev/null 2>&1; thenimax=50sleepit="perl -e 'select(undef, undef, undef, 0.20)'"else@@ -2458,7 +2458,7 @@if [ "X$use_sshssl" = "X" -a "X$getport" = "X" ]; thenecho "Running viewer:"- trap "final" 0 2 15+ trap "final" 0 INT TERMif [ "X$reverse" = "X" ]; thenecho "$VNCVIEWERCMD" "$@" $localhost:$Necho ""@@ -2515,7 +2515,7 @@fiif [ "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:elseecho ""@@ -2624,7 +2624,7 @@if [ "X$ciphers" != "X" ]; thencipher_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:elseecho ""@@ -2735,7 +2735,7 @@if [ "X$getport" = "X" ]; thensleep 1fi- elif type printf > /dev/null 2>&1; then+ elif which printf > /dev/null 2>&1; thenprintf "Are you sure you want to continue? [y]/n "read xelse@@ -2798,7 +2798,7 @@fihostdisp2=`echo "$hostdisp" | sed -e 's/pw=[^ ]*/pw=******/g'`echo "$VNCVIEWERCMD" "$@" "$hostdisp2"- trap "final" 0 2 15+ trap "final" 0 INT TERMecho ""$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 TERMif [ "X$SSVNC_ULTRA_DSM" != "X" ]; thenecho "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"fiecho "$VNCVIEWERCMD" "$@" "$vnc_hp"- trap "final" 0 2 15+ trap "final" 0 INT TERMecho ""$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 TERMN2=$NN2_trim=`echo "$N2" | sed -e 's/://g'`if [ $N2_trim -le 200 ]; then