port within app script generator

This commit is contained in:
Bob Mottram 2018-02-06 18:21:35 +00:00
parent 17395a0b3c
commit 51ceb967a5
1 changed files with 14 additions and 4 deletions

View File

@ -38,6 +38,7 @@ app_repo="TODO"
app_repo_commit='TODO'
app_php=
app_node=
app_port=''
your_name=''
your_email=''
SHOW_ON_ABOUT=1
@ -56,6 +57,7 @@ function show_help {
echo $' -e --email [address] Your email address'
echo $' -r --repo [url] Git repo url for the app'
echo $' -c --commit [hash] Git commit'
echo $' --port [number] Port number for the app'
echo $' --node [yes|no] Is this a nodejs app?'
echo $' -p --php [yes|no] Is this a PHP app?'
echo $' -d --database [mariadb|postgresql] Type of database'
@ -106,6 +108,10 @@ do
shift
app_node="$1"
;;
--port)
shift
app_port="$1"
;;
*)
# unknown option
;;
@ -482,10 +488,10 @@ echo ' fi'
echo " remove_app ${app_name}"
echo " remove_completion_param install_${app_name}"
echo " sed -i '/${app_name}/d' \$COMPLETION_FILE"
echo ''
echo " if grep -q '${app_name}-firewall' /etc/crontab; then"
echo " sed -i '/${app_name}-firewall/d' /etc/crontab"
echo ' fi'
if [ ${#app_port} -gt 0 ]; then
echo ''
echo " firewall_remove ${app_port} tcp"
fi
echo ''
echo " remove_ddns_domain \$${app_name_upper}_DOMAIN_NAME"
echo '}'
@ -643,6 +649,10 @@ echo ' systemctl restart nginx'
echo ''
echo " \${PROJECT_NAME}-pass -u \$MY_USERNAME -a ${app_name} -p \"\$${app_name_upper}_ADMIN_PASSWORD\""
echo " set_completion_param \"${app_name} domain\" \"\$${app_name_upper}_DOMAIN_NAME\""
if [ ${#app_port} -gt 0 ]; then
echo ''
echo " firewall_add ${app_name} ${app_port} tcp"
fi
echo ''
echo ' APP_INSTALLED=1'
echo '}'