Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replaces the non-repository managed web interface for pihole and keep… #155

Merged
merged 1 commit into from Jan 11, 2016
Merged

Conversation

ghost
Copy link

@ghost ghost commented Jan 10, 2016

This PR will replace the non-managed /var/www/html/admin directory with the git managed repo.

The first time the script is ran on an existing installation, it will:

  • Remove the existing /var/www/html/admin directory
  • Clone jacobsalema/AdminLTE to /var/www/html/admin

Subsequent runs of this script will:

  • Pull the latest master branch from jaconsalema/AdminLTE to /var/www/html/admin

I'm not sure if this fits in the scope of what you hope to do with pi-hole, but if it does I would like to call this script in the basic-install.sh process. There would need to be some minor tweaks, but I think it would make updating the web interface a trivial process.

Below is the process debug:

First Time Run:

# bash update-webinterface.sh 
+ WEB_INTERFACE_GIT_URL=https://github.com/jacobsalmela/AdminLTE.git
+ WEB_INTERFACE_DIR=/var/www/html/admin
+ main
+ prerequisites
+ [[ 0 -ne 0 ]]
+ '[' '!' -d /var/www/html/admin ']'
+ type git
+ is_repo
+ '[' '!' -d /var/www/html/admin/.git ']'
+ return 1
+ make_repo
+ rm -rf /var/www/html/admin
+ git clone https://github.com/jacobsalmela/AdminLTE.git /var/www/html/admin
Cloning into '/var/www/html/admin'...
remote: Counting objects: 7229, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 7229 (delta 1), reused 0 (delta 0), pack-reused 7222
Receiving objects: 100% (7229/7229), 17.30 MiB | 1.28 MiB/s, done.
Resolving deltas: 100% (4074/4074), done.
Checking connectivity... done.
+ update_repo
+ cd /var/www/html/admin
+ git pull
Already up-to-date.

Subsequent Runs:

# bash update-webinterface.sh 
+ WEB_INTERFACE_GIT_URL=https://github.com/jacobsalmela/AdminLTE.git
+ WEB_INTERFACE_DIR=/var/www/html/admin
+ main
+ prerequisites
+ [[ 0 -ne 0 ]]
+ '[' '!' -d /var/www/html/admin ']'
+ type git
+ is_repo
+ '[' '!' -d /var/www/html/admin/.git ']'
+ return 0
+ update_repo
+ cd /var/www/html/admin
+ git pull
Already up-to-date.

@jacobsalmela
Copy link
Contributor

This would act as a nice mechanism to keep it up-to-date. I'll test it out and see how it works.

@jacobsalmela
Copy link
Contributor

This works great. One minor thing is that when my interface was updated, the last line still said Already up-to-date., implying nothing updated, which it did.

Cloning into '/var/www/html/admin'...
remote: Counting objects: 7232, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 7232 (delta 3), reused 0 (delta 0), pack-reused 7222
Receiving objects: 100% (7232/7232), 17.31 MiB | 1.50 MiB/s, done.
Resolving deltas: 100% (4076/4076), done.
Checking connectivity... done.
Already up-to-date.

Running it a second time just returned this result:

Already up-to-date.

So maybe the verbiage could be changed, but besides that this is great!

jacobsalmela added a commit that referenced this pull request Jan 11, 2016
replaces the non-repository managed web interface for pihole and keep…
@jacobsalmela jacobsalmela merged commit b5bdfe2 into pi-hole:master Jan 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant