Skip to content

Scripts check for root user #3

@belugabehr

Description

@belugabehr

This does not cover the case where a user logs in and then changes to root sudo su

if [[ ! ${USER} =~ .*root* ]]
then
echo "Script must be run as root: exiting"
exit 1
fi

if [[ ! ${USER} =~ .*root.* ]]
then
echo "Script must be run as root: exiting"
exit 1
fi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions