#vim script.sh
#/bin/bash
if [ $(id -u) != "0" ]; then
echo "Error: You must be root to run this script."
else
echo "Script is running from root user "
exit 1
fi
#chmod o+x script.sh
Test script from root user
# ./check.sh
Script is run by root
Test script from non root user
$
./check.sh
Error: You must be root to run this script.
I gathered as much knowledge regarding to the Linux, web sever and database server from your site.Keep on updating with more interesting topic.
ReplyDeleteMoreover to recover the lost file from Linux Click on:
android data recovery review
launch android data recovery
backup and restore android apps and data
android backup app data
recover lost files
diskdigger pro file recovery