gameservergame-servergame-servershacktoberfestdedicated-game-serversgamelinuxgsmserverbashgaminglinuxmultiplayer-game-servershell
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
563 B
21 lines
563 B
#!/bin/bash
|
|
# LGSM check_permissions function
|
|
# Author: Daniel Gibbs
|
|
# Contributor: UltimateByte
|
|
# Website: http://gameservermanagers.com
|
|
lgsm_version="150316"
|
|
|
|
# Description: Checks script, files and folders ownership and permissions.
|
|
|
|
# Initializing useful variables
|
|
currentuser="$(sh -c 'whoami')"
|
|
scriptfullpath="${rootdir}/${selfname}"
|
|
|
|
fn_check_ownership(){
|
|
if [ "${currentuser}" != "$(stat -c %U ${scripfullpath})" ] || [ "${currentuser}" != "$(stat -c %G ${scripfullpath})" ]; then
|
|
fn_print_fail_nl "Permission denied"
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
fn_check_ownership
|
|
|