mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-01-29 18:59:04 +01:00
quotas for al8/9
This commit is contained in:
@@ -153,6 +153,11 @@ class preFlightsChecks:
|
||||
command,
|
||||
1, 0, os.EX_OSERR)
|
||||
|
||||
self.edit_fstab('/', '/')
|
||||
|
||||
command = 'mount -o remount /'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
##
|
||||
|
||||
if self.distro == ubuntu:
|
||||
@@ -171,42 +176,42 @@ class preFlightsChecks:
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
|
||||
self.edit_fstab('/','/')
|
||||
self.edit_fstab('/','/')
|
||||
|
||||
command = 'mount -o remount /'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
command = 'quotacheck -ugm /'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
####
|
||||
|
||||
command = "find /lib/modules/ -type f -name '*quota_v*.ko*'"
|
||||
iResult = subprocess.run(command, capture_output=True, text=True, shell=True)
|
||||
print(repr(iResult.stdout))
|
||||
|
||||
# Only if the first command works, run the rest
|
||||
|
||||
if iResult.returncode == 0:
|
||||
command = "echo '{}' | sed -n 's|/lib/modules/\\([^/]*\\)/.*|\\1|p' | sort -u".format(iResult.stdout)
|
||||
result = subprocess.run(command, capture_output=True, text=True, shell=True)
|
||||
fResult = result.stdout.rstrip('\n')
|
||||
print(repr(result.stdout.rstrip('\n')))
|
||||
|
||||
command = 'uname -r'
|
||||
ffResult = subprocess.run(command, capture_output=True, text=True, shell=True)
|
||||
ffResult = ffResult.stdout.rstrip('\n')
|
||||
|
||||
command = f"apt-get install linux-modules-extra-{ffResult}"
|
||||
command = 'mount -o remount /'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
###
|
||||
|
||||
command = f'modprobe quota_v1 -S {ffResult}'
|
||||
command = 'quotacheck -ugm /'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
command = f'modprobe quota_v2 -S {ffResult}'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
####
|
||||
|
||||
command = "find /lib/modules/ -type f -name '*quota_v*.ko*'"
|
||||
iResult = subprocess.run(command, capture_output=True, text=True, shell=True)
|
||||
print(repr(iResult.stdout))
|
||||
|
||||
# Only if the first command works, run the rest
|
||||
|
||||
if iResult.returncode == 0:
|
||||
command = "echo '{}' | sed -n 's|/lib/modules/\\([^/]*\\)/.*|\\1|p' | sort -u".format(iResult.stdout)
|
||||
result = subprocess.run(command, capture_output=True, text=True, shell=True)
|
||||
fResult = result.stdout.rstrip('\n')
|
||||
print(repr(result.stdout.rstrip('\n')))
|
||||
|
||||
command = 'uname -r'
|
||||
ffResult = subprocess.run(command, capture_output=True, text=True, shell=True)
|
||||
ffResult = ffResult.stdout.rstrip('\n')
|
||||
|
||||
command = f"apt-get install linux-modules-extra-{ffResult}"
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
###
|
||||
|
||||
command = f'modprobe quota_v1 -S {ffResult}'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
command = f'modprobe quota_v2 -S {ffResult}'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
command = f'quotacheck -ugm /'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
Reference in New Issue
Block a user