()
| 209 | |
| 210 | # Package panel |
| 211 | def PackagePanel(): |
| 212 | print('========================================================') |
| 213 | print('|-Cleaning log information...'), |
| 214 | public.M('logs').where('id!=?', (0,)).delete() |
| 215 | print('\t\t\033[1;32m[done]\033[0m') |
| 216 | print('|-Cleaning task history...'), |
| 217 | public.M('tasks').where('id!=?', (0,)).delete() |
| 218 | print('\t\t\033[1;32m[done]\033[0m') |
| 219 | print('|-Cleaning network monitoring records...'), |
| 220 | public.M('network').dbfile('system').where('id!=?', (0,)).delete() |
| 221 | print('\t\033[1;32m[done]\033[0m') |
| 222 | print('|-Cleaning CPU monitoring records...'), |
| 223 | public.M('cpuio').dbfile('system').where('id!=?', (0,)).delete() |
| 224 | print('\t\033[1;32m[done]\033[0m') |
| 225 | print('|-Cleaning disk monitoring records...'), |
| 226 | public.M('diskio').dbfile('system').where('id!=?', (0,)).delete() |
| 227 | print('\t\033[1;32m[done]\033[0m') |
| 228 | print('|-Cleaning IP information...'), |
| 229 | os.system('rm -f /www/server/panel/data/iplist.txt') |
| 230 | os.system('rm -f /www/server/panel/data/address.pl') |
| 231 | os.system('rm -f /www/server/panel/data/*.login') |
| 232 | os.system('rm -f /www/server/panel/data/domain.conf') |
| 233 | os.system('rm -f /www/server/panel/data/user*') |
| 234 | os.system('rm -f /www/server/panel/data/admin_path.pl') |
| 235 | os.system('rm -rf /www/backup/panel/*') |
| 236 | os.system('rm -f /root/.ssh/*') |
| 237 | |
| 238 | print('\t\033[1;32m[done]\033[0m') |
| 239 | print('|-Cleaning system usage traces...'), |
| 240 | command = '''cat /dev/null > /var/log/boot.log |
| 241 | cat /dev/null > /var/log/btmp |
| 242 | cat /dev/null > /var/log/cron |
| 243 | cat /dev/null > /var/log/dmesg |
| 244 | cat /dev/null > /var/log/firewalld |
| 245 | cat /dev/null > /var/log/grubby |
| 246 | cat /dev/null > /var/log/lastlog |
| 247 | cat /dev/null > /var/log/mail.info |
| 248 | cat /dev/null > /var/log/maillog |
| 249 | cat /dev/null > /var/log/messages |
| 250 | cat /dev/null > /var/log/secure |
| 251 | cat /dev/null > /var/log/spooler |
| 252 | cat /dev/null > /var/log/syslog |
| 253 | cat /dev/null > /var/log/tallylog |
| 254 | cat /dev/null > /var/log/wpa_supplicant.log |
| 255 | cat /dev/null > /var/log/wtmp |
| 256 | cat /dev/null > /var/log/yum.log |
| 257 | history -c |
| 258 | ''' |
| 259 | os.system(command) |
| 260 | print('\t\033[1;32m[done]\033[0m') |
| 261 | if sys.version_info[0] == 3: |
| 262 | a_input = input('|-Automatically optimize PHP/MySQL configuration on first boot?(y/n default: y): ') |
| 263 | else: |
| 264 | a_input = raw_input('|-Automatically optimize PHP/MySQL configuration on first boot?(y/n default: y): ') |
| 265 | if not a_input: a_input = 'y' |
| 266 | print(a_input) |
| 267 | if not a_input in ['Y', 'y', 'yes', 'YES']: |
| 268 | public.ExecShell("rm -f /www/server/panel/php_mysql_auto.pl") |
no test coverage detected