FC2ブログ

TEMP

ffftp_バージョン
ffftp_暗号化タブ
スポンサーサイト



お試しChatoGPT

#!/bin/bash

# Path to the CSV file containing hostname, user_id, password entries (comma-separated)
file_path="ftp_credentials.csv"

# Read the file line by line
while IFS= read -r line || [[ -n "$line" ]]; do
# Split the line using commas as separators
IFS=',' read -ra fields <<< "$line"
hostname="${fields[0]}"
user_id="${fields[1]}"
password="${fields[2]}"

# Attempt FTP login
echo "Attempting login to $hostname with user $user_id..."
if ftp -inv $hostname < user $user_id $password
quit
EOF
then
echo "Login successful!"
else
echo "Login failed!"
fi

echo "----------------------------------------"
done < "$file_path"



#!/bin/bash

# Path to the CSV file containing hostname, user_id, password entries (comma-separated)
file_path="ftp_credentials.csv"

# Path to the log file for exporting the test results
log_file="ftp_login_test.log"

# Clear the log file before starting the test
> "$log_file"

# Read the file line by line
while IFS= read -r line || [[ -n "$line" ]]; do
# Split the line using commas as separators
IFS=',' read -ra fields <<< "$line"
hostname="${fields[0]}"
user_id="${fields[1]}"
password="${fields[2]}"

# Attempt FTP login and export logs to the log file
echo "Attempting login to $hostname with user $user_id..." | tee -a "$log_file"
if ftp -inv $hostname < user $user_id $password
quit
EOF
then
echo "Login successful!" | tee -a "$log_file"
else
echo "Login failed!" | tee -a "$log_file"
fi

echo "----------------------------------------" | tee -a "$log_file"
done < "$file_path"

カウンター
プロフィール

itoby

Author:itoby
サラリーマン業以外でお金がほしい。

別で電柱もアップしてます。
今日の電柱
#こちらは最近停滞気味…

New!
マインクラフトのサーバー建ててます。
是非遊びに来てください。
https://tobibuta.pgw.jp

最新記事
リンク
カテゴリ
スポンサードリンク
検索フォーム
問い合わせはこちらから

名前:
メール:
件名:
本文:

Amazon.co.jp