mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-26 01:00:33 +00:00
man page for pihole-FTL
Signed-off-by: Rob Gill <rrobgill@protonmail.com>
This commit is contained in:
parent
808e310799
commit
ed7ebfd58d
5 changed files with 212 additions and 48 deletions
|
@ -1194,7 +1194,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"
|
||||
|
@ -1204,23 +1204,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