import script
This commit is contained in:
9
backup.sh
Normal file
9
backup.sh
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# vi: set tabstop=4 shiftwidth=4 expandtab :
|
||||||
|
BASENAME=$(basename "$(cd "$(dirname "$0")" && pwd)")
|
||||||
|
ARCHIVE=$BASENAME-$(date +%Y%m%d)
|
||||||
|
|
||||||
|
echo 'Backup...'
|
||||||
|
tar -cf - -- \
|
||||||
|
*.sh \
|
||||||
|
| 7z a -bso0 -si $ARCHIVE.tar.7z
|
||||||
3
env.sh
Normal file
3
env.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
DKRNAME=tools--phpmyadmin
|
||||||
|
NAME=phpMyAdmin
|
||||||
7
logs.sh
Executable file
7
logs.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# vi: set tabstop=4 shiftwidth=4 expandtab :
|
||||||
|
ROOTDIR=$(cd "$(dirname "$0")" && pwd)
|
||||||
|
cd $ROOTDIR
|
||||||
|
. ./env.sh
|
||||||
|
|
||||||
|
docker logs --tail 10 -f $DKRNAME
|
||||||
8
shell.sh
Executable file
8
shell.sh
Executable file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# vi: set tabstop=4 shiftwidth=4 expandtab :
|
||||||
|
ROOTDIR=$(cd "$(dirname "$0")" && pwd)
|
||||||
|
cd $ROOTDIR
|
||||||
|
. ./env.sh
|
||||||
|
|
||||||
|
echo "Enter shell in $NAME container..."
|
||||||
|
docker exec -it $DKRNAME bash
|
||||||
21
start.sh
Executable file
21
start.sh
Executable file
@@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# vi: set tabstop=4 shiftwidth=4 expandtab :
|
||||||
|
ROOTDIR=$(cd "$(dirname "$0")" && pwd)
|
||||||
|
cd $ROOTDIR
|
||||||
|
. ./env.sh
|
||||||
|
|
||||||
|
|
||||||
|
if [[ -n $(docker ps -q --filter "name=$DKRNAME") ]]
|
||||||
|
then
|
||||||
|
echo "$NAME is runned."
|
||||||
|
else
|
||||||
|
echo "Start $NAME container..."
|
||||||
|
docker run -d \
|
||||||
|
--name "$DKRNAME" \
|
||||||
|
--memory '512M' \
|
||||||
|
--volume /etc/timezone:/etc/timezone:ro \
|
||||||
|
--volume /etc/localtime:/etc/localtime:ro \
|
||||||
|
--publish 0.0.0.0:9091:80 \
|
||||||
|
--env 'PMA_ARBITRARY=1' \
|
||||||
|
phpmyadmin:5.1.1-apache
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user