added root check function

master
Mateusz Chochół 7 years ago
parent c6ba6eb8c2
commit 68fc5098fb
  1. 8
      bmotd.sh

@ -7,7 +7,12 @@
MOTD="/etc/motd"
INSTPATH="/etc/bmotd.sh"
# Check if root
main () {
isRoot && echo 'You are root' || echo 'You are NOT root'
# Gather information
HOSTNAME=$(hostname -s)
FQDN=$(hostname -f)
@ -206,6 +211,9 @@ function parse_ifconfig() {
done;
}
function isRoot() {
! (( ${EUID:-0} || $(id -u) ))
}
motdGen() {
# The different colours as variables

Loading…
Cancel
Save