Forwarded from hosein seilany https://seilany.ir/
آموزش شل اسکریپت نویسی:
اسکریپتی برای بررسی روت بودن کاربر جاری:
testroot.sh
######################
#!/bin/bash
if [ "$(whoami)" != 'root' ]; then
echo "You have no permission to run $0 as non-root user."
exit 1;
fi
#################################
#bash testroot.sh
اسکریپتی برای بررسی روت بودن کاربر جاری:
testroot.sh
######################
#!/bin/bash
if [ "$(whoami)" != 'root' ]; then
echo "You have no permission to run $0 as non-root user."
exit 1;
fi
#################################
#bash testroot.sh
❤1