SPRKLstats/init.py

25 lines
695 B
Python

# Author: Stefan Weijers https://github.com/Stxfie
import os
from config import bcolors
#Create motd entry
try:
motdscript = open('/etc/update-motd.d/stats', 'w')
os.system('chmod +x /etc/update-motd.d/stats')
except:
print('[' + bcolors.FULL + 'IMPORTANT' + bcolors.RESET + ']')
print('Make sure you run the program as root!')
quit()
cwd = os.getcwd()
motdscript.write('#!/bin/bash\n{}/start.sh'.format(cwd))
#Create start script
startscript = open('start.sh', 'w')
startscript.write('#!/bin/bash\npython3 {}/time.py\necho\npython3 {}/diskusage.py\necho\npython3 {}/services.py'.format(cwd, cwd, cwd))
os.system('chmod +x {}/start.sh'.format(cwd))
print('All done!')