mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-25 08:40:12 +00:00
Merge pull request #2212 from rrobgill/man-pages
Man page for pilhole-FTL
This commit is contained in:
commit
6689e00e6a
5 changed files with 258 additions and 48 deletions
|
@ -1251,7 +1251,7 @@ installConfigs() {
|
|||
}
|
||||
|
||||
install_manpage() {
|
||||
# Copy Pi-hole man page and call mandb to update man page database
|
||||
# Copy Pi-hole man pages and call mandb to update man page database
|
||||
# Default location for man files for /usr/local/bin is /usr/local/share/man
|
||||
# on lightweight systems may not be present, so check before copying.
|
||||
echo -en " ${INFO} Testing man page installation"
|
||||
|
@ -1261,23 +1261,30 @@ install_manpage() {
|
|||
return
|
||||
elif [[ ! -d "/usr/local/share/man" ]]; then
|
||||
# appropriate directory for Pi-hole's man page is not present
|
||||
echo -e "${OVER} ${INFO} man page not installed"
|
||||
echo -e "${OVER} ${INFO} man pages not installed"
|
||||
return
|
||||
elif [[ ! -d "/usr/local/share/man/man8" ]]; then
|
||||
fi
|
||||
if [[ ! -d "/usr/local/share/man/man8" ]]; then
|
||||
# if not present, create man8 directory
|
||||
mkdir /usr/local/share/man/man8
|
||||
fi
|
||||
# Testing complete, copy the file & update the man db
|
||||
cp ${PI_HOLE_LOCAL_REPO}/pihole.8 /usr/local/share/man/man8/pihole.8
|
||||
if [[ ! -d "/usr/local/share/man/man5" ]]; then
|
||||
# if not present, create man8 directory
|
||||
mkdir /usr/local/share/man/man5
|
||||
fi
|
||||
# Testing complete, copy the files & update the man db
|
||||
cp ${PI_HOLE_LOCAL_REPO}/manpages/pihole.8 /usr/local/share/man/man8/pihole.8
|
||||
cp ${PI_HOLE_LOCAL_REPO}/manpages/pihole-FTL.8 /usr/local/share/man/man8/pihole-FTL.8
|
||||
cp ${PI_HOLE_LOCAL_REPO}/manpages/pihole-FTL.conf.5 /usr/local/share/man/man5/pihole-FTL.conf.5
|
||||
if mandb -q &>/dev/null; then
|
||||
# Updated successfully
|
||||
echo -e "${OVER} ${TICK} man page installed and database updated"
|
||||
echo -e "${OVER} ${TICK} man pages installed and database updated"
|
||||
return
|
||||
else
|
||||
# Something is wrong with the system's man installation, clean up
|
||||
# our file, (leave everything how we found it).
|
||||
rm /usr/local/share/man/man8/pihole.8
|
||||
echo -e "${OVER} ${CROSS} man page db not updated, man page not installed"
|
||||
# our files, (leave everything how we found it).
|
||||
rm /usr/local/share/man/man8/pihole.8 /usr/local/share/man/man8/pihole-FTL.8 /usr/local/share/man/man5/pihole-FTL.conf.5
|
||||
echo -e "${OVER} ${CROSS} man page db not updated, man pages not installed"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue