Created
September 30, 2017 14:21
-
-
Save nakamkaz/1b5e6a4af0c5c93bd751cfabe09812a2 to your computer and use it in GitHub Desktop.
OpenBSD check config at first
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Utility Functions | |
######################### | |
loudrun() { | |
echo "RUN: '"$@"'" | |
$@ | |
} | |
backupconf(){ | |
local targetfile=$1 | |
if [ -e "${targetfile}" ]; then | |
local fmd5=$(md5 ${targetfile} | awk '{print $NF}' ) | |
loudrun cp -p "${targetfile}" "${targetfile}_${fmd5}.bak" | |
loudrun mv "${targetfile}_${fmd5}.bak" ./ | |
else | |
echo ${targetfile} " not found" | |
fi | |
} | |
######################### | |
loudrun cat /etc/mygate | |
loudrun cat /etc/hostname.* | |
loudrun cat /etc/kbdtype | |
loudrun cat /etc/resolv.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sh checklist.sh | |
RUN: 'cat /etc/mygate' | |
192.168.1.1 | |
RUN: 'cat /etc/hostname.hvn0' | |
inet 192.168.1.119 255.255.255.0 | |
up | |
rtsol | |
RUN: 'cat /etc/kbdtype' | |
us | |
RUN: 'cat /etc/resolv.conf' | |
lookup file bind | |
nameserver 192.168.1.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment