Skip to content

Commit

Permalink
fix naming issues in debian installation files
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesottinger committed Apr 20, 2016
1 parent 47c8534 commit 85c5716
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
38 changes: 19 additions & 19 deletions debian/linode-longview.config
Original file line number Diff line number Diff line change
Expand Up @@ -42,30 +42,30 @@ apache_status_path() {
if [ ! -z $apache_url ]; then
if _check_apache_url $apache_url ; then
echoerr "Found Apache status page at $apache_url specified in $apache_config_filename"
db_set Longivew/apache-location ""
db_set Longview/apache-location ""
return 0
elif [ "$apache_url" = "$apache_default_url" ]; then
echoerr "Attempt to access $apache_url specified in $apache_config_filename failed..."
else
echoerr "Attempt to access $apache_url specified in $apache_config_filename failed...trying default"
if _check_apache_url $apache_default_url; then
echoerr "Found Apache status page at $apache_default_url (default URL)"
db_set Longivew/apache-location "$apache_default_url"
db_set Longview/apache-location "$apache_default_url"
return 0;
elif _check_apache_url $apache_default_https; then
echoerr "Found Apache status page at $apache_default_https"
db_set Longivew/apache-location "$apache_default_https"
db_set Longview/apache-location "$apache_default_https"
return 0;
fi
fi
else
if _check_apache_url $apache_default_url; then
echoerr "Found Apache status page at $apache_default_url (default URL)"
db_set Longivew/apache-location "$apache_default_url"
db_set Longview/apache-location "$apache_default_url"
return 0;
elif _check_apache_url $apache_default_https; then
echoerr "Found Apache status page at $apache_default_https"
db_set Longivew/apache-location "$apache_default_https"
db_set Longview/apache-location "$apache_default_https"
return 0;
fi
fi
Expand All @@ -75,12 +75,12 @@ apache_status_path() {
if [ ! -z $guess_url ]; then
if _check_apache_url http://127.0.0.1$guess_url?auto; then
echoerr "Found Apache status page at http://127.0.0.1$guess_url?auto"
db_set Longivew/apache-location "http://127.0.0.1$guess_url?auto"
db_set Longview/apache-location "http://127.0.0.1$guess_url?auto"
return 0
fi
fi

db_set Longivew/apache-location "$apache_default_url"
db_set Longview/apache-location "$apache_default_url"
db_fset Longview/apache-try-configure seen "false"
db_input high Longview/apache-try-configure
}
Expand All @@ -97,57 +97,57 @@ nginx_status_path(){
if [ ! -z $nginx_url ]; then
if _check_nginx_url $nginx_url; then
echoerr "Found nginx status page at $nginx_url specified in $nginx_config_filename"
db_set Longivew/nginx-location ""
db_set Longview/nginx-location ""
return 0
elif [ "$nginx_url" = "$nginx_default_url" ]; then
echoerr "Attempt to access $nginx_url specified in $nginx_config_filename failed..."
else
echoerr "Attempt to access $nginx_url specified in $nginx_config_filename failed...trying default"
if _check_nginx_url $nginx_default_url; then
echoerr "Found nginx status page at $nginx_default_url (default URL)"
db_set Longivew/nginx-location ""
db_set Longview/nginx-location ""
return 0;
elif _check_nginx_url $nginx_default_https; then
echoerr "Found nginx status page at $nginx_default_https"
db_set Longivew/nginx-location "$nginx_default_https"
db_set Longview/nginx-location "$nginx_default_https"
return 0;
fi
fi
fi

if _check_nginx_url $nginx_default_url; then
echoerr "Found nginx status page at $nginx_default_url (default URL)"
db_set Longivew/nginx-location ""
db_set Longview/nginx-location ""
return 0;
elif _check_nginx_url $nginx_default_https; then
echoerr "Found nginx status page at $nginx_default_https"
db_set Longivew/nginx-location "$nginx_default_https"
db_set Longview/nginx-location "$nginx_default_https"
return 0;
fi

# don't be smart unless we know where to work
if [ ! -d /etc/nginx/sites-enabled ]; then
echoerr "Unable to automatically configure nginx for Longview. Please see https://library.linode.com/longview/longview-for-nginx#sph_manual-configuration-all-distributions"
db_set Longivew/nginx-location ""
db_set Longview/nginx-location ""
return 0
fi

# this is kind of weird
# check to make sure that the haxor mode is gonna work
if grep -ri '^[[:space:]]*server_name.*127\.0\.0\.2' /etc/nginx/sites-enabled; then
echoerr "Unable to automatically configure nginx for Longview. Please see https://library.linode.com/longview/longview-for-nginx#sph_manual-configuration-all-distributions"
db_set Longivew/nginx-location ""
db_set Longview/nginx-location ""
return 0
fi

if [ -e /etc/nginx/sites-available/longview ]; then
if _check_nginx_url http://127.0.0.2/nginx_status; then
echoerr "Found location configured by Longview previously."
db_set Longivew/nginx-location "http://127.0.0.2/nginx_status"
db_set Longview/nginx-location "http://127.0.0.2/nginx_status"
return 0
fi
echoerr "Unable to automatically configure nginx for Longview. Please see https://library.linode.com/longview/longview-for-nginx#sph_manual-configuration-all-distributions"
db_set Longivew/nginx-location ""
db_set Longview/nginx-location ""
return 0
fi
db_input high Longview/nginx-try-configure || true
Expand All @@ -163,7 +163,7 @@ mysql_cred_check() {
if [ ! -z $mysql_username ] && [ ! -z $mysql_password ]; then
if _mysql_check_install $mysql_username $mysql_password; then
echoerr "Successfully connected to MySQL with the credentials located in $mysql_config_filename"
db_set Longivew/mysql-password ""
db_set Longview/mysql-password ""
return 0
else
echoerr "Unable to connect using the credentials specified in $mysql_config_filename...trying Debian maintenance user"
Expand All @@ -174,7 +174,7 @@ mysql_cred_check() {
mysql_password=$(egrep '^\s*password\s*=\s*' /etc/mysql/debian.cnf | head -n1 | sed 's/^\s*password\s*=\s*//')
if _mysql_check_install debian-sys-maint $mysql_password; then
echoerr "Successfully connected to MySQL"
db_set Longivew/mysql-password ""
db_set Longview/mysql-password ""
if [ ! -z $mysql_username ] && [ ! -z $mysql_password ]; then
db_subst Longview/mysql-overwrite-creds found_user "$mysql_username"
db_input high Longview/mysql-overwrite-creds || true
Expand All @@ -188,7 +188,7 @@ mysql_cred_check() {

create_statement="CREATE USER 'linode-longview'@'localhost' IDENTIFIED BY '$mysql_password';"

db_set Longivew/mysql-password "$mysql_password"
db_set Longview/mysql-password "$mysql_password"
db_subst Longview/mysql-create-creds create_statement "$create_statement"
db_input high Longview/mysql-create-creds || true
}
Expand Down
6 changes: 3 additions & 3 deletions debian/linode-longview.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ _write_option(){
apache_install() {
apache_config_filename=${longview_config_dir}Apache.conf

db_get Longivew/apache-location
db_get Longview/apache-location
location="$RET"

if [ ! -z "$location" ]; then
Expand Down Expand Up @@ -103,7 +103,7 @@ END
nginx_install() {
nginx_config_filename=${longview_config_dir}Nginx.conf

db_get Longivew/nginx-location
db_get Longview/nginx-location
location="$RET"

if [ ! -z "$location" ]; then
Expand Down Expand Up @@ -166,7 +166,7 @@ mysql_install() {
if [ ! -z "$pass" ]; then
_write_option $mysql_config_filename username "linode-longview"
_write_option $mysql_config_filename password "$pass"
db_set Longivew/mysql-password ""
db_set Longview/mysql-password ""
return 0
fi
}
Expand Down
6 changes: 3 additions & 3 deletions debian/linode-longview.templates
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Default:
Description: Please enter your Longview API Key:
Please enter your Longview API Key.

Template: Longivew/apache-location
Template: Longview/apache-location
Type: string
Default:
Description: Mod_Status URL:
Expand All @@ -18,7 +18,7 @@ Description: Autoconfigure Mod_Status:
the server status page. Would you like to attempt to automatically configure
mod_status? This will require reloading Apache to enable.

Template: Longivew/nginx-location
Template: Longview/nginx-location
Type: string
Default:
Description: Nginx Status URL:
Expand Down Expand Up @@ -51,7 +51,7 @@ Description: Overwrite existing Longview MySQL config:
'debian-sys-maint' user was found, would you like to configure longview to
use those credentials instead?

Template: Longivew/mysql-password
Template: Longview/mysql-password
Type: string
Default:
Description: Longview Mysql user password:
Expand Down

0 comments on commit 85c5716

Please sign in to comment.