#!/bin/bash
################################################################################
# Script name: bin_copy_v1.0.sh #
# Author: SoD #
# Contact: SoD- @ EFNet #
# Releasedate: 2001-08-16 #
# #
# This script copies a bunch of sometimes needed binaries to glftpd's bin-dir #
# and chmods them to 755. #
# #
# Installation: -Just execute this script as root and give the path to your #
# glftpd's bin-dir as argument. #
# #
# Requirements: Root access to the computer. #
################################################################################
BINARIES="awk bash basename chmod chown cat cp cut date df diff dirname du \
echo expand expr fgrep find grep gzip head kill ldconfig ln ls mkdir more \
mount mv rm rmdir sed sh sleep tail touch tr unzip wc zip"
if [ ! $UID = 0 ]; then
echo "You need to be root to execute this script."
exit 1
fi
if [ -z $1 ]; then
echo ".------------------------------------------------------------------------------."
echo "| This script copies some useful binaries to you glftpd bin-directory. |"
echo "| |"
echo "| Usage: bin_copy_v1.0.sh (path to glftpd's binary dir) |"
echo "| Example: ./bin_copy_v1.0.sh /glftpd/bin/ |"
echo "'------------------------------------------------------------------------------'"
exit
fi
if [ ! -d $1 ]; then
echo "The directory \"$1\" can't be found."
exit 1
fi
if [ ! -f "$1/glftpd" ] && [ ! -f "$1glftpd" ]; then
echo "The glftpd binary can't be found in \"$1\"."
exit 1
fi
for BINARY in $BINARIES; do
if [ ! -f "$1/$BINARY" ] && [ ! -f "$1$BINARY" ]; then
if [ ! "`whereis -b $BINARY | awk '{print $2}'`" ]; then
echo "Couldnt find the binary \"$BINARY\" on computer. Copy it manually."
else
echo "Copying `whereis -b $BINARY | awk '{print $2}'`"
cp `whereis -b $BINARY | awk '{print $2}'` $1
if [ -e "$1/$BINARY" ]; then
chmod 755 $1/$BINARY
else
chmod 755 $1$BINARY
fi
fi
fi
done