Skip to content

Instantly share code, notes, and snippets.

@pengmaradi
Last active June 3, 2018 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pengmaradi/4cf34dee28ba610e68a5aaca4033982a to your computer and use it in GitHub Desktop.
Save pengmaradi/4cf34dee28ba610e68a5aaca4033982a to your computer and use it in GitHub Desktop.
first shell script

First Shell Script

#!/bin/bash
#for i in "1" "2" "3" "4" "5" "6" "7" "8" "9"
#do
#        for j in "1" "2" "3" "4" "5" "6" "7" "8" "9"
#  do
#          if [ ${j} -lt  ${i} ]
#          then
#            k=$((i * j))
#            echo -n ${i}*${j}=${k}$'\t'
#          fi
#          if [ ${j} -eq ${i} ]
#          then
#            k=$((i * j))
#            echo   ${i}*${j}=${k}
#          fi
#  done
#done


# cp the system to new
cp -r ../$1/fileadmin ./
cp -r ../$1/uploads ./
cp -r ../$1/typo3conf ./
cp -r ../$1/.htaccess ./
gitignore=".gitignore"
if [ -f "$gitignore" ]
	then
		cp -r ../$1/.gitignore ./
fi
git = ".git"
if [ -d "$git" ]
	then
		cp -r ../$1/.git ./
		echo 'copied git'
	else
		echo 'no .git found'
fi
ls -la





# create a new DB $4 and cp from $3
# $1 user $2 pwd $3 old db_name $4 new db_name
#if [ $# == 4 ]
#	then	
		#mysqldump -u $1 -p$2 $3 > typo3_new.sql;
		#mysql -u $1 -p$2 CREATE DATABASE $4 CHARACTER SET utf8 COLLATE utf8_general_ci;
		#mysql -u $1 -p$2 $4 < typo3_new.sql;
#		echo "created $4 and copied from $3"
#	else
#		echo 'please enter you mysql user-name, password, old sql DB name, new DB name'
#fi

# get TYPO3 7.6.12
#---------------------------------------------------
if [ $1 ]
	then
		echo 'you will get TYPO3' $1
		wget https://get.typo3.org/$1
		ls -la
		echo 'you got it'
		mv $1 typo3_src-$1.tar.gz
		tar xvf typo3_src-$1.tar.gz
		rm typo3_src-$1.tar.gz
		echo 'finished'
		ls -la
	else
		echo 'please ente TYPO3 Version for example: 6.2.28'
fi
# end
#--------------------------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment