|
|
|
@ -15,6 +15,7 @@
|
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
from cl_print import color_print
|
|
|
|
|
from cl_utils import _error
|
|
|
|
@ -25,6 +26,15 @@ lang().setLanguage(sys.modules[__name__])
|
|
|
|
|
|
|
|
|
|
class share_cmd(color_print, _error):
|
|
|
|
|
"""Класс общих методов обработки опций командной строки"""
|
|
|
|
|
def isRoot(self, printError=True):
|
|
|
|
|
"""Detect root user"""
|
|
|
|
|
if os.getuid() == 0 and os.getgid() == 0:
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
if printError:
|
|
|
|
|
self.printERROR(_("The user is not root"))
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
def printVars(self, optObj):
|
|
|
|
|
"""Process displaying variables"""
|
|
|
|
|
if optObj.v:
|
|
|
|
|