#!/bin/sh

# Installer script for joggler pack: ssh

# Packed by Paul Gregg, pgregg at pgregg dot com

echo -n "... /usr/bin/ssh"
if [ ! -f "/usr/bin/ssh" -o "$1" = "-force" ]; then
  if [ ! -d "/usr/bin" ]; then
    echo -n " ... creating directory /usr/bin"
    mkdir -p "/usr/bin"
  fi
  cp -d -p "./usr/bin/ssh" "/usr/bin/ssh"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /lib/tls/i686/cmov/libresolv.so.2"
if [ ! -f "/lib/tls/i686/cmov/libresolv.so.2" -o "$1" = "-force" ]; then
  if [ ! -d "/lib/tls/i686/cmov" ]; then
    echo -n " ... creating directory /lib/tls/i686/cmov"
    mkdir -p "/lib/tls/i686/cmov"
  fi
  cp -d -p "./lib/tls/i686/cmov/libresolv.so.2" "/lib/tls/i686/cmov/libresolv.so.2"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /lib/tls/i686/cmov/libresolv-2.7.so"
if [ ! -f "/lib/tls/i686/cmov/libresolv-2.7.so" -o "$1" = "-force" ]; then
  if [ ! -d "/lib/tls/i686/cmov" ]; then
    echo -n " ... creating directory /lib/tls/i686/cmov"
    mkdir -p "/lib/tls/i686/cmov"
  fi
  cp -d -p "./lib/tls/i686/cmov/libresolv-2.7.so" "/lib/tls/i686/cmov/libresolv-2.7.so"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /usr/lib/i686/cmov/libcrypto.so.0.9.8"
if [ ! -f "/usr/lib/i686/cmov/libcrypto.so.0.9.8" -o "$1" = "-force" ]; then
  if [ ! -d "/usr/lib/i686/cmov" ]; then
    echo -n " ... creating directory /usr/lib/i686/cmov"
    mkdir -p "/usr/lib/i686/cmov"
  fi
  cp -d -p "./usr/lib/i686/cmov/libcrypto.so.0.9.8" "/usr/lib/i686/cmov/libcrypto.so.0.9.8"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /lib/tls/i686/cmov/libutil.so.1"
if [ ! -f "/lib/tls/i686/cmov/libutil.so.1" -o "$1" = "-force" ]; then
  if [ ! -d "/lib/tls/i686/cmov" ]; then
    echo -n " ... creating directory /lib/tls/i686/cmov"
    mkdir -p "/lib/tls/i686/cmov"
  fi
  cp -d -p "./lib/tls/i686/cmov/libutil.so.1" "/lib/tls/i686/cmov/libutil.so.1"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /lib/tls/i686/cmov/libutil-2.7.so"
if [ ! -f "/lib/tls/i686/cmov/libutil-2.7.so" -o "$1" = "-force" ]; then
  if [ ! -d "/lib/tls/i686/cmov" ]; then
    echo -n " ... creating directory /lib/tls/i686/cmov"
    mkdir -p "/lib/tls/i686/cmov"
  fi
  cp -d -p "./lib/tls/i686/cmov/libutil-2.7.so" "/lib/tls/i686/cmov/libutil-2.7.so"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /lib/tls/i686/cmov/libnsl.so.1"
if [ ! -f "/lib/tls/i686/cmov/libnsl.so.1" -o "$1" = "-force" ]; then
  if [ ! -d "/lib/tls/i686/cmov" ]; then
    echo -n " ... creating directory /lib/tls/i686/cmov"
    mkdir -p "/lib/tls/i686/cmov"
  fi
  cp -d -p "./lib/tls/i686/cmov/libnsl.so.1" "/lib/tls/i686/cmov/libnsl.so.1"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /lib/tls/i686/cmov/libnsl-2.7.so"
if [ ! -f "/lib/tls/i686/cmov/libnsl-2.7.so" -o "$1" = "-force" ]; then
  if [ ! -d "/lib/tls/i686/cmov" ]; then
    echo -n " ... creating directory /lib/tls/i686/cmov"
    mkdir -p "/lib/tls/i686/cmov"
  fi
  cp -d -p "./lib/tls/i686/cmov/libnsl-2.7.so" "/lib/tls/i686/cmov/libnsl-2.7.so"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /lib/tls/i686/cmov/libcrypt.so.1"
if [ ! -f "/lib/tls/i686/cmov/libcrypt.so.1" -o "$1" = "-force" ]; then
  if [ ! -d "/lib/tls/i686/cmov" ]; then
    echo -n " ... creating directory /lib/tls/i686/cmov"
    mkdir -p "/lib/tls/i686/cmov"
  fi
  cp -d -p "./lib/tls/i686/cmov/libcrypt.so.1" "/lib/tls/i686/cmov/libcrypt.so.1"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /lib/tls/i686/cmov/libcrypt-2.7.so"
if [ ! -f "/lib/tls/i686/cmov/libcrypt-2.7.so" -o "$1" = "-force" ]; then
  if [ ! -d "/lib/tls/i686/cmov" ]; then
    echo -n " ... creating directory /lib/tls/i686/cmov"
    mkdir -p "/lib/tls/i686/cmov"
  fi
  cp -d -p "./lib/tls/i686/cmov/libcrypt-2.7.so" "/lib/tls/i686/cmov/libcrypt-2.7.so"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /usr/lib/libgssapi_krb5.so.2"
if [ ! -f "/usr/lib/libgssapi_krb5.so.2" -o "$1" = "-force" ]; then
  if [ ! -d "/usr/lib" ]; then
    echo -n " ... creating directory /usr/lib"
    mkdir -p "/usr/lib"
  fi
  cp -d -p "./usr/lib/libgssapi_krb5.so.2" "/usr/lib/libgssapi_krb5.so.2"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /usr/lib/libgssapi_krb5.so.2.2"
if [ ! -f "/usr/lib/libgssapi_krb5.so.2.2" -o "$1" = "-force" ]; then
  if [ ! -d "/usr/lib" ]; then
    echo -n " ... creating directory /usr/lib"
    mkdir -p "/usr/lib"
  fi
  cp -d -p "./usr/lib/libgssapi_krb5.so.2.2" "/usr/lib/libgssapi_krb5.so.2.2"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /usr/lib/libkrb5.so.3"
if [ ! -f "/usr/lib/libkrb5.so.3" -o "$1" = "-force" ]; then
  if [ ! -d "/usr/lib" ]; then
    echo -n " ... creating directory /usr/lib"
    mkdir -p "/usr/lib"
  fi
  cp -d -p "./usr/lib/libkrb5.so.3" "/usr/lib/libkrb5.so.3"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /usr/lib/libkrb5.so.3.3"
if [ ! -f "/usr/lib/libkrb5.so.3.3" -o "$1" = "-force" ]; then
  if [ ! -d "/usr/lib" ]; then
    echo -n " ... creating directory /usr/lib"
    mkdir -p "/usr/lib"
  fi
  cp -d -p "./usr/lib/libkrb5.so.3.3" "/usr/lib/libkrb5.so.3.3"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /usr/lib/libk5crypto.so.3"
if [ ! -f "/usr/lib/libk5crypto.so.3" -o "$1" = "-force" ]; then
  if [ ! -d "/usr/lib" ]; then
    echo -n " ... creating directory /usr/lib"
    mkdir -p "/usr/lib"
  fi
  cp -d -p "./usr/lib/libk5crypto.so.3" "/usr/lib/libk5crypto.so.3"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /usr/lib/libk5crypto.so.3.1"
if [ ! -f "/usr/lib/libk5crypto.so.3.1" -o "$1" = "-force" ]; then
  if [ ! -d "/usr/lib" ]; then
    echo -n " ... creating directory /usr/lib"
    mkdir -p "/usr/lib"
  fi
  cp -d -p "./usr/lib/libk5crypto.so.3.1" "/usr/lib/libk5crypto.so.3.1"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /lib/tls/i686/cmov/libc.so.6"
if [ ! -f "/lib/tls/i686/cmov/libc.so.6" -o "$1" = "-force" ]; then
  if [ ! -d "/lib/tls/i686/cmov" ]; then
    echo -n " ... creating directory /lib/tls/i686/cmov"
    mkdir -p "/lib/tls/i686/cmov"
  fi
  cp -d -p "./lib/tls/i686/cmov/libc.so.6" "/lib/tls/i686/cmov/libc.so.6"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /lib/tls/i686/cmov/libc-2.7.so"
if [ ! -f "/lib/tls/i686/cmov/libc-2.7.so" -o "$1" = "-force" ]; then
  if [ ! -d "/lib/tls/i686/cmov" ]; then
    echo -n " ... creating directory /lib/tls/i686/cmov"
    mkdir -p "/lib/tls/i686/cmov"
  fi
  cp -d -p "./lib/tls/i686/cmov/libc-2.7.so" "/lib/tls/i686/cmov/libc-2.7.so"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /lib/tls/i686/cmov/libdl.so.2"
if [ ! -f "/lib/tls/i686/cmov/libdl.so.2" -o "$1" = "-force" ]; then
  if [ ! -d "/lib/tls/i686/cmov" ]; then
    echo -n " ... creating directory /lib/tls/i686/cmov"
    mkdir -p "/lib/tls/i686/cmov"
  fi
  cp -d -p "./lib/tls/i686/cmov/libdl.so.2" "/lib/tls/i686/cmov/libdl.so.2"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /lib/tls/i686/cmov/libdl-2.7.so"
if [ ! -f "/lib/tls/i686/cmov/libdl-2.7.so" -o "$1" = "-force" ]; then
  if [ ! -d "/lib/tls/i686/cmov" ]; then
    echo -n " ... creating directory /lib/tls/i686/cmov"
    mkdir -p "/lib/tls/i686/cmov"
  fi
  cp -d -p "./lib/tls/i686/cmov/libdl-2.7.so" "/lib/tls/i686/cmov/libdl-2.7.so"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /usr/lib/libkrb5support.so.0"
if [ ! -f "/usr/lib/libkrb5support.so.0" -o "$1" = "-force" ]; then
  if [ ! -d "/usr/lib" ]; then
    echo -n " ... creating directory /usr/lib"
    mkdir -p "/usr/lib"
  fi
  cp -d -p "./usr/lib/libkrb5support.so.0" "/usr/lib/libkrb5support.so.0"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /usr/lib/libkrb5support.so.0.1"
if [ ! -f "/usr/lib/libkrb5support.so.0.1" -o "$1" = "-force" ]; then
  if [ ! -d "/usr/lib" ]; then
    echo -n " ... creating directory /usr/lib"
    mkdir -p "/usr/lib"
  fi
  cp -d -p "./usr/lib/libkrb5support.so.0.1" "/usr/lib/libkrb5support.so.0.1"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /lib/libkeyutils.so.1"
if [ ! -f "/lib/libkeyutils.so.1" -o "$1" = "-force" ]; then
  if [ ! -d "/lib" ]; then
    echo -n " ... creating directory /lib"
    mkdir -p "/lib"
  fi
  cp -d -p "./lib/libkeyutils.so.1" "/lib/libkeyutils.so.1"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /lib/libkeyutils-1.2.so"
if [ ! -f "/lib/libkeyutils-1.2.so" -o "$1" = "-force" ]; then
  if [ ! -d "/lib" ]; then
    echo -n " ... creating directory /lib"
    mkdir -p "/lib"
  fi
  cp -d -p "./lib/libkeyutils-1.2.so" "/lib/libkeyutils-1.2.so"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /usr/bin/scp"
if [ ! -f "/usr/bin/scp" -o "$1" = "-force" ]; then
  if [ ! -d "/usr/bin" ]; then
    echo -n " ... creating directory /usr/bin"
    mkdir -p "/usr/bin"
  fi
  cp -d -p "./usr/bin/scp" "/usr/bin/scp"
  echo " OK"
else
  echo " SKIPPED - exists."
fi

echo -n "... /usr/lib/openssh/sftp-server"
if [ ! -f "/usr/lib/openssh/sftp-server" -o "$1" = "-force" ]; then
  if [ ! -d "/usr/lib/openssh" ]; then
    echo -n " ... creating directory /usr/lib/openssh"
    mkdir -p "/usr/lib/openssh"
  fi
  cp -d -p "./usr/lib/openssh/sftp-server" "/usr/lib/openssh/sftp-server"
  echo " OK"
else
  echo " SKIPPED - exists."
fi


echo "Installation of ssh complete."
