Репозиторий Sisyphus
Последнее обновление: 19 июля 2019 | Пакетов: 17691 | Посещений: 14355938
en ru br
Репозитории ALT
S:0.9.18-alt3
D:0.9.3-alt3.1
5.1: 0.9.10-alt4.M51.1
4.1: 0.9.7-alt0.M41.1
4.0: 0.9.7-alt0.M40.1
3.0: 0.7.14-alt1
+updates:0.7.16-alt1
www.altlinux.org/Changes

Группа :: Система/Основа
Пакет: etcnet

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: etcnet-ossh.patch
Скачать


commit 2d24fa9108c3032e3e5835eee18bb8f23b902ccb
Author: Alexey Gladkov <legion@altlinux.org>
Date:   Fri Mar 27 14:24:08 2009 +0300
    *-ossh: Add profile support
    
    Signed-off-by: Alexey Gladkov <legion@altlinux.org>
diff --git a/etc/net/scripts/create-ossh b/etc/net/scripts/create-ossh
index 0936869..840d266 100755
--- a/etc/net/scripts/create-ossh
+++ b/etc/net/scripts/create-ossh
@@ -40,16 +40,15 @@ modprobe_tuntap || {
 
 $TUNCTL -t $NAME > /dev/null
 
-profiled_filename IDENTITY "${OSSHIDENTITY:-$DEFAULT_OSSHIDENTITY}" ||
-	IDENTITY="${OSSHIDENTITY:-$DEFAULT_OSSHIDENTITY}"
+OSSHIDENTITY="$MYIFACEDIR/${OSSHIDENTITY:-$DEFAULT_OSSHIDENTITY}"
 
-[ -f "$MYIFACEDIR/$IDENTITY" ] || {
-    print_error "identity file '$MYIFACEDIR/$IDENTITY' does not exist"
+if ! profiled_filename IDENTITY "$OSSHIDENTITY"; then
+    print_error "identity file '$OSSHIDENTITY' does not exist"
     exit 1
-}
+fi
 
 if is_yes "$IFUP_REMOTE"; then
-    $OSSH -i "$MYIFACEDIR/$IDENTITY" ${REMOTEPORT:+-p $REMOTEPORT} \
+    $OSSH -i "$IDENTITY" ${REMOTEPORT:+-p $REMOTEPORT} \
 	${REMOTEUSER:+$REMOTEUSER@}${REMOTE} ${REMOTEIFUP:-/sbin/ifup $REMOTEIF}
     [ $? -eq 0 ] || {
 	print_error "failed to bring remote iface $REMOTEIF up"
@@ -57,5 +56,5 @@ if is_yes "$IFUP_REMOTE"; then
     }
 fi
 
-$OSSH -i "$MYIFACEDIR/$IDENTITY" ${REMOTEPORT:+-p $REMOTEPORT} -f -M -o "controlpath /var/run/etcnet-ossh-$NAME" \
+$OSSH -i "$IDENTITY" ${REMOTEPORT:+-p $REMOTEPORT} -f -M -o "controlpath /var/run/etcnet-ossh-$NAME" \
     -o "tunnel ${TUNTAP_MODE}" -w ${TUNTAP_NR}:${REMOTE_NR:-any} ${REMOTEUSER:+$REMOTEUSER@}${REMOTE} /bin/true
diff --git a/etc/net/scripts/destroy-ossh b/etc/net/scripts/destroy-ossh
index 99dbd47..c434600 100755
--- a/etc/net/scripts/destroy-ossh
+++ b/etc/net/scripts/destroy-ossh
@@ -23,14 +23,13 @@ pickup_options
 }
 
 if is_yes "$IFUP_REMOTE"; then
-    profiled_filename IDENTITY "${OSSHIDENTITY:-$DEFAULT_OSSHIDENTITY}" ||
-	    IDENTITY="${OSSHIDENTITY:-$DEFAULT_OSSHIDENTITY}"
-    if [ -f "$MYIFACEDIR/$IDENTITY" ]; then
-	$OSSH -i "$MYIFACEDIR/$IDENTITY" ${REMOTEPORT:+-p $REMOTEPORT} \
+    OSSHIDENTITY="$MYIFACEDIR/${OSSHIDENTITY:-$DEFAULT_OSSHIDENTITY}"
+    if profiled_filename IDENTITY "$OSSHIDENTITY"; then
+	$OSSH -i "$IDENTITY" ${REMOTEPORT:+-p $REMOTEPORT} \
 	    ${REMOTEUSER:+$REMOTEUSER@}${REMOTE} ${REMOTEIFDOWN:-/sbin/ifdown $REMOTEIF}
 	[ $? -eq 0 ] || print_error "failed to bring remote iface $REMOTEIF down"
     else
-	print_error "identity file '$MYIFACEDIR/$IDENTITY' does not exist"
+	print_error "identity file '$OSSHIDENTITY' does not exist"
     fi
 fi
 
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin