Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SHELL := /bin/bash
- default:
- @echo "Welcome!";
- echo -n "Please enter the MySQL host (default: localhost):";
- read host;
- host=${host:-localhost};
- echo -n "Please enter the MySQL username:";
- read username;
- echo -n "Please enter the MySQL password:";
- read -s password;
- mv includes/config.php.example includes/config.php 2>/dev/null;true;
- sed 's/"USER", ""/"USER", "$(username)"/g' includes/config.php > includes/config.php;
- sed 's/"PASSWORD", ""/"PASSWORD", "$(password)"/g' includes/config.php > includes/conf$
- echo $username;
- echo $password;
- mysql -u "$username" -p"$password" codeday-team < ./codeday-team.sql;
- echo "Configuration complete. For further configuration options, check the config file$
- exit 0;
- Welcome!
- Please enter the MySQL host (default: localhost):
- Please enter the MySQL username:<snip>
- Please enter the MySQL password:sername
- assword
- ERROR 1045 (28000): Access denied for user 'sername'@'localhost' (using password: YES)
- Configuration complete. For further configuration options, check the config file includes/config.php
- echo $username;
- echo $password;
- #! /usr/bin/env bash
- printf 'WelcomenPlease enter the MySQL host (default: localhost): '
- read host || exit
- host=${host:-localhost}
- printf "Please enter the MySQL username: "
- read username || exit
- printf "Please enter the MySQL password:"
- IFS= read -rs password || exit
- mv includes/config.php.example includes/config.php 2>/dev/null
- repl=${password//\/\\}
- repl=${repl//&/\&}
- repl=${repl//:/\:}
- { rm includes/config.php &&
- sed 's/"USER", ""/"USER", "$username"/g
- s:"PASSWORD", "":"PASSWORD", "'"$repl"'"/g' > includes/config.php
- } < includes/config.php || exit
- mysql -u "$username" -p"$password" codeday-team < ./codeday-team.sql || exit
- echo "Configuration complete. For further configuration options, check the config file"
- mysql --defaults-file=<(
- printf '[client]nuser=%snpassword="%s"n' "$username" "$password") ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement