From e15e7ae6d7b6ccad7c5d378215d912ac0898d09f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luna=20=C5=9Awi=C4=85tek?= Date: Tue, 7 Nov 2023 08:44:41 +0100 Subject: [PATCH] new scripts --- bin/hosts.sh | 13 +++++++++++++ bin/mysql_upload.sh | 9 +++++++++ 2 files changed, 22 insertions(+) create mode 100755 bin/hosts.sh create mode 100755 bin/mysql_upload.sh diff --git a/bin/hosts.sh b/bin/hosts.sh new file mode 100755 index 0000000..8cba0d0 --- /dev/null +++ b/bin/hosts.sh @@ -0,0 +1,13 @@ +#!/bin/bash +#bash hosts.sh domain.pl serwer.lh.pl +if [ $# -eq 2 ]; then + DOMAIN=$1 + SERWER=$2 +else +echo "DOMAIN:" +read DOMAIN +echo "SERWER:" +read SERWER +fi +IP=`dig +short A $SERWER | tr -d '\n'` +echo "$IP $DOMAIN www.$DOMAIN" | tee -a /etc/hosts diff --git a/bin/mysql_upload.sh b/bin/mysql_upload.sh new file mode 100755 index 0000000..74810e9 --- /dev/null +++ b/bin/mysql_upload.sh @@ -0,0 +1,9 @@ +#!/bin/bash +if [ $# -le 2 ]; then + echo $0 "db&user_name" "serwer_address" "sql_dump_path" + exit +fi +name=$1 +filename=$3 +serwer=$2 +mysql -h $serwer -u $name $name -vp < $filename