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