-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7be6338
commit a6d4307
Showing
7 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
resources/views/ssh/services/database/mariadb/backup.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
if ! sudo DEBIAN_FRONTEND=noninteractive mysqldump -u root {{ $database }} > {{ $file }}.sql; then | ||
echo 'VITO_SSH_ERROR' && exit 1 | ||
fi | ||
|
||
if ! DEBIAN_FRONTEND=noninteractive zip {{ $file }}.zip {{ $file }}.sql; then | ||
echo 'VITO_SSH_ERROR' && exit 1 | ||
fi | ||
|
||
if ! rm {{ $file }}.sql; then | ||
echo 'VITO_SSH_ERROR' && exit 1 | ||
fi |
9 changes: 9 additions & 0 deletions
9
resources/views/ssh/services/database/mariadb/create-user.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
if ! sudo mysql -e "CREATE USER IF NOT EXISTS '{{ $username }}'@'{{ $host }}' IDENTIFIED BY '{{ $password }}'"; then | ||
echo 'VITO_SSH_ERROR' && exit 1 | ||
fi | ||
|
||
if ! sudo mysql -e "FLUSH PRIVILEGES"; then | ||
echo 'VITO_SSH_ERROR' && exit 1 | ||
fi | ||
|
||
echo "Command executed" |
5 changes: 5 additions & 0 deletions
5
resources/views/ssh/services/database/mariadb/create.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if ! sudo mysql -e "CREATE DATABASE IF NOT EXISTS {{ $name }} CHARACTER SET utf8 COLLATE utf8_general_ci"; then | ||
echo 'VITO_SSH_ERROR' && exit 1 | ||
fi | ||
|
||
echo "Command executed" |
9 changes: 9 additions & 0 deletions
9
resources/views/ssh/services/database/mariadb/delete-user.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
if ! sudo mysql -e "DROP USER IF EXISTS '{{ $username }}'@'{{ $host }}'"; then | ||
echo 'VITO_SSH_ERROR' && exit 1 | ||
fi | ||
|
||
if ! sudo mysql -e "FLUSH PRIVILEGES"; then | ||
echo 'VITO_SSH_ERROR' && exit 1 | ||
fi | ||
|
||
echo "Command executed" |
5 changes: 5 additions & 0 deletions
5
resources/views/ssh/services/database/mariadb/delete.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if ! sudo mysql -e "DROP DATABASE IF EXISTS {{ $name }}"; then | ||
echo 'VITO_SSH_ERROR' && exit 1 | ||
fi | ||
|
||
echo "Command executed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
if ! sudo mysql -e "GRANT ALL PRIVILEGES ON {{ $database }}.* TO '{{ $username }}'@'{{ $host }}'"; then | ||
echo 'VITO_SSH_ERROR' && exit 1 | ||
fi | ||
|
||
if ! sudo mysql -e "FLUSH PRIVILEGES"; then | ||
echo 'VITO_SSH_ERROR' && exit 1 | ||
fi | ||
|
||
echo "Linking to {{ $database }} finished" |
5 changes: 5 additions & 0 deletions
5
resources/views/ssh/services/database/mariadb/unlink.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if ! sudo mysql -e "REVOKE ALL PRIVILEGES, GRANT OPTION FROM '{{ $username }}'@'{{ $host }}'"; then | ||
echo 'VITO_SSH_ERROR' && exit 1 | ||
fi | ||
|
||
echo "Command executed" |