Skip to content
Snippets Groups Projects
Commit e2cd8715 authored by Bob Mottram's avatar Bob Mottram
Browse files

Don't show domain for onion only installs

parent bb59ccd9
No related branches found
No related tags found
No related merge requests found
......@@ -102,6 +102,12 @@ function webadmin_update_version {
}
function web_admin_create_add_apps {
if grep -q 'ONION_ONLY=' "$CONFIGURATION_FILE"; then
ONION_ONLY=$(grep 'ONION_ONLY=' "$CONFIGURATION_FILE" | head -n 1 | awk -F '=' '{print $2}')
else
ONION_ONLY='no'
fi
appslist_add_filename="$webadmin_install_dir/apps_add.html"
apps_add_template_filename="$webadmin_install_dir/apps_add_template.html"
......@@ -204,6 +210,14 @@ function web_admin_create_add_apps {
sed -i "s|APPNAME|${app_name}|g" "$filename"
sed -i "s|APPDESCRIPTION|${DESCRIPTION}|g" "$filename"
# remove domain if onion only
if [[ "$ONION_ONLY" != 'no' ]]; then
if grep -q 'install_domain' "$filename"; then
sed -i '/install_domain/d' "$filename"
fi
sed -i "/installappconfirm.php/a <input type=\"hidden\" name=\"install_domain\" value=\"${app_name}.$(hostname)\">" "$filename"
fi
if grep -q 'freedns_code' "$filename"; then
sed -i '/freedns_code/d' "$filename"
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment