Skip create table in kstore-init if db exist
This commit is contained in:
parent
b134d89d40
commit
8e368db056
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
.DS_Store
|
||||
*.prod
|
||||
*.log
|
||||
|
@ -63,7 +63,8 @@ function kstore-secret {
|
||||
}
|
||||
|
||||
function kstore-init {
|
||||
cat <<___SQL___ | $_SQLITE "$_AUTH_DB"
|
||||
if [ ! -f "$_AUTH_DB" ]; then
|
||||
cat <<___SQL___ | $_SQLITE "$_AUTH_DB"
|
||||
CREATE TABLE IF NOT EXISTS store (
|
||||
key TEXT NOT NULL
|
||||
, prop TEXT NOT NULL
|
||||
@ -71,6 +72,8 @@ CREATE TABLE IF NOT EXISTS store (
|
||||
, PRIMARY KEY( key ASC, prop ASC )
|
||||
);
|
||||
___SQL___
|
||||
chmod 600 "$_AUTH_DB"
|
||||
fi
|
||||
kstore secret config
|
||||
}
|
||||
|
||||
|
@ -14,8 +14,8 @@ function kcontext {
|
||||
docker) shift; kcontext-docker "$@" ;;
|
||||
s3-arch) shift; kcontext-s3-arch "$@" ;;
|
||||
*)
|
||||
__func_help "k8s ..."
|
||||
__func_head "s3-arch ..."
|
||||
__func_head "k8s ..."
|
||||
__func_help "s3-arch ..."
|
||||
__func_help "docker ..."
|
||||
return 1
|
||||
;;
|
||||
|
Loading…
Reference in New Issue
Block a user