mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-25 06:10:20 +00:00
Merge pull request #749 from pi-hole/feature/installMethod
Change installScripts to use install
This commit is contained in:
commit
a4c3464bc8
1 changed files with 17 additions and 26 deletions
|
@ -524,26 +524,17 @@ versionCheckDNSmasq(){
|
||||||
|
|
||||||
installScripts() {
|
installScripts() {
|
||||||
# Install the scripts from /etc/.pihole to their various locations
|
# Install the scripts from /etc/.pihole to their various locations
|
||||||
${SUDO} echo ":::"
|
echo ":::"
|
||||||
${SUDO} echo -n "::: Installing scripts to /opt/pihole..."
|
echo -n "::: Installing scripts to /opt/pihole..."
|
||||||
if [ ! -d /opt/pihole ]; then
|
${SUDO} install -o "${USER}" -m755 -d /opt/pihole
|
||||||
${SUDO} mkdir /opt/pihole
|
|
||||||
${SUDO} chown "$USER":root /opt/pihole
|
cd /etc/.pihole/
|
||||||
${SUDO} chmod u+srwx /opt/pihole
|
|
||||||
fi
|
${SUDO} install -o "${USER}" -Dm755 -t /opt/pihole/ gravity.sh
|
||||||
${SUDO} cp /etc/.pihole/gravity.sh /opt/pihole/gravity.sh
|
${SUDO} install -o "${USER}" -Dm755 -t /opt/pihole/ ./advanced/Scripts/*.sh
|
||||||
${SUDO} cp /etc/.pihole/advanced/Scripts/chronometer.sh /opt/pihole/chronometer.sh
|
${SUDO} install -o "${USER}" -Dm755 -t /usr/local/bin/ pihole
|
||||||
${SUDO} cp /etc/.pihole/advanced/Scripts/whitelist.sh /opt/pihole/whitelist.sh
|
|
||||||
${SUDO} cp /etc/.pihole/advanced/Scripts/blacklist.sh /opt/pihole/blacklist.sh
|
${SUDO} install -Dm644 ./advanced/bash-completion/pihole /etc/bash_completion.d/pihole
|
||||||
${SUDO} cp /etc/.pihole/advanced/Scripts/piholeDebug.sh /opt/pihole/piholeDebug.sh
|
|
||||||
${SUDO} cp /etc/.pihole/advanced/Scripts/piholeLogFlush.sh /opt/pihole/piholeLogFlush.sh
|
|
||||||
${SUDO} cp /etc/.pihole/automated\ install/uninstall.sh /opt/pihole/uninstall.sh
|
|
||||||
${SUDO} cp /etc/.pihole/advanced/Scripts/setupLCD.sh /opt/pihole/setupLCD.sh
|
|
||||||
${SUDO} cp /etc/.pihole/advanced/Scripts/version.sh /opt/pihole/version.sh
|
|
||||||
${SUDO} chmod 755 /opt/pihole/gravity.sh /opt/pihole/chronometer.sh /opt/pihole/whitelist.sh /opt/pihole/blacklist.sh /opt/pihole/piholeLogFlush.sh /opt/pihole/uninstall.sh /opt/pihole/setupLCD.sh /opt/pihole/version.sh
|
|
||||||
${SUDO} cp /etc/.pihole/pihole /usr/local/bin/pihole
|
|
||||||
${SUDO} chmod 755 /usr/local/bin/pihole
|
|
||||||
${SUDO} cp /etc/.pihole/advanced/bash-completion/pihole /etc/bash_completion.d/pihole
|
|
||||||
. /etc/bash_completion.d/pihole
|
. /etc/bash_completion.d/pihole
|
||||||
|
|
||||||
#Tidy up /usr/local/bin directory if installing over previous install.
|
#Tidy up /usr/local/bin directory if installing over previous install.
|
||||||
|
@ -554,13 +545,13 @@ installScripts() {
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
${SUDO} echo " done."
|
echo " done."
|
||||||
}
|
}
|
||||||
|
|
||||||
installConfigs() {
|
installConfigs() {
|
||||||
# Install the configs from /etc/.pihole to their various locations
|
# Install the configs from /etc/.pihole to their various locations
|
||||||
${SUDO} echo ":::"
|
echo ":::"
|
||||||
${SUDO} echo "::: Installing configs..."
|
echo "::: Installing configs..."
|
||||||
versionCheckDNSmasq
|
versionCheckDNSmasq
|
||||||
if [ ! -d "/etc/lighttpd" ]; then
|
if [ ! -d "/etc/lighttpd" ]; then
|
||||||
${SUDO} mkdir /etc/lighttpd
|
${SUDO} mkdir /etc/lighttpd
|
||||||
|
@ -576,15 +567,15 @@ installConfigs() {
|
||||||
|
|
||||||
stopServices() {
|
stopServices() {
|
||||||
# Stop dnsmasq and lighttpd
|
# Stop dnsmasq and lighttpd
|
||||||
${SUDO} echo ":::"
|
echo ":::"
|
||||||
${SUDO} echo -n "::: Stopping services..."
|
echo -n "::: Stopping services..."
|
||||||
#$SUDO service dnsmasq stop & spinner $! || true
|
#$SUDO service dnsmasq stop & spinner $! || true
|
||||||
if [ -x "$(command -v systemctl)" ]; then
|
if [ -x "$(command -v systemctl)" ]; then
|
||||||
${SUDO} systemctl stop lighttpd & spinner $! || true
|
${SUDO} systemctl stop lighttpd & spinner $! || true
|
||||||
else
|
else
|
||||||
${SUDO} service lighttpd stop & spinner $! || true
|
${SUDO} service lighttpd stop & spinner $! || true
|
||||||
fi
|
fi
|
||||||
${SUDO} echo " done."
|
echo " done."
|
||||||
}
|
}
|
||||||
|
|
||||||
installerDependencies() {
|
installerDependencies() {
|
||||||
|
|
Loading…
Reference in a new issue