Some text fixes

master
Mateusz Chochół 8 years ago
parent ed469dbb53
commit 1288b4bb09
  1. 7
      README.md
  2. 13
      statesnap.sh

@ -1,9 +1,10 @@
# Statesnap
Ever had problem with running services after server reboot?
This script snaps state of things such as:
Ever had to reboot server you don't know well and were anxoious about whether all services will startup?
This script might help by snaping state of things such as:
- List of unique processes names
- List of opened TCP/UDP ports along with proces name
- Firewall rules dump
- Routing table
- Mount points
After restart, you can use the script to create diff's with latest snaps made, making it easy to find out what isn't working.
After restart, you can use the script to view color diff's of latest snaps made, making it easy to find out what isn't working or missing.

@ -55,8 +55,15 @@ function compare {
echo -e "$GREEN\nRouting table diff$RST"; HL; routingTable | diff - $FOLDER/routing.out | colorDiff
}
function nonRootExit {
if [[ $EUID -ne 0 ]]; then
msg "This command must be run as root"
exit 1
fi
}
function printHelp {
echo -e "State Snap 0.2b"; HL
echo -e "State Snap 0.3"; HL
echo -e "Use: $0 [PARAMETRS]...\n"
printf " $GREEN%-6s$RST %s\n" "snap" "- Make server status snapshot"
printf " $GREEN%-6s$RST %s\n\n" "diff" "- Make a diff comparison against latest snapshot"
@ -71,13 +78,15 @@ fi
# główny kod
case $1 in
diff)
nonRootExit
compare
;;
snap)
nonRootExit
makeSnap
;;
*)
msg "Nieprawidłowa komenda. Uruchom \"$0 help\" celem wyświetlenia pomocy"
msg "Unrecognised command. Run \"$0 help\" to view help."
;;
esac

Loading…
Cancel
Save