You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.4 KiB
61 lines
1.4 KiB
#!/bin/bash
|
|
|
|
### DO NOT EDIT THIS FILE
|
|
|
|
plesk_included=true
|
|
|
|
function pleskValidate {
|
|
local env=$(getArgument "$1" "Usage: pleskValidate [live|stage]" "live stage")
|
|
|
|
if [ "$ssh_included" == "" ]
|
|
then
|
|
echo >&2
|
|
echoError "Plugin \"ssh\" has to be included" >&2
|
|
echo >&2
|
|
exit
|
|
fi
|
|
|
|
if [ "$db_included" == "" ]
|
|
then
|
|
echo >&2
|
|
echoError "Plugin \"db\" has to be included" >&2
|
|
echo >&2
|
|
exit
|
|
fi
|
|
|
|
if [ "$plesk_host" == "" ] || [ "$plesk_user" == "" ]
|
|
then
|
|
echo >&2
|
|
echoError "Please configure $project_manager_dir/data/$customer/$project/etc/plugins/plesk/config" >&2
|
|
echo >&2
|
|
exit
|
|
fi
|
|
|
|
if [ "$(dbGetConfig "$env" "user")" == "" ] || [ "$(dbGetConfig "$env" "database")" == "" ] || [ "$(dbGetConfig "$env" "password")" == "" ]
|
|
then
|
|
echo >&2
|
|
echoError "Please configure $project_manager_dir/data/$customer/$project/etc/plugins/db/config" >&2
|
|
echo >&2
|
|
exit
|
|
fi
|
|
}
|
|
|
|
function pleskAddSSHKey {
|
|
if [ ! -f "$plesk_private_key" ] && [ ! -f "$app_dir/.ssh/plesk" ]
|
|
then
|
|
sshGenerateKey "plesk"
|
|
sshCopyIdKey "plesk" "$plesk_user@$plesk_host" "$app_dir/.ssh/plesk.pub"
|
|
fi
|
|
|
|
if [ -f "$plesk_private_key" ] && [ ! -f "$app_dir/.ssh/plesk" ]
|
|
then
|
|
sshCopyKey "plesk" "$plesk_private_key"
|
|
fi
|
|
|
|
if [ -f "$plesk_public_key" ] && [ ! -f "$app_dir/.ssh/plesk.pub" ]
|
|
then
|
|
sshCopyKey "plesk.pub" "$plesk_private_key"
|
|
fi
|
|
|
|
ssh-add "$app_dir/.ssh/plesk"
|
|
}
|