Blame view

php/backup_file.php 1.46 KB
cf76164e6   Ting Chan   20190709
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  <?php
   //include('../cfg/file_name.php');
   shell_exec("sudo chmod 777 /etc/network/interfaces");
   shell_exec("sudo chown -R pi.pi /home/pi/Desktop/vAlert/bin");
  
   shell_exec("sudo rm /var/www/index.html");
   shell_exec("sudo chmod 777 /home/pi");
   shell_exec("sudo chmod 777 /home/pi/Desktop/vAlert/rec");
   shell_exec("sudo chmod 777 /home/pi/Desktop/vAlert/log");
  
   shell_exec("sudo chmod 777 /home/pi/Desktop/vAlert/rec/*.csv");
   shell_exec("sudo chmod 777 /home/pi/Desktop/vAlert/rec/*.mseed");
   shell_exec("sudo chown -R pi.pi /home/pi/Desktop/vAlert/rec");
   shell_exec("sudo chmod 777 /home/pi/Desktop/vAlert/log/*");
   shell_exec("sudo chown -R pi.pi /home/pi/Desktop/vAlert/log");
   shell_exec("sudo chmod 777 /var/www");
   shell_exec("sudo chown -R pi.pi /var/www");
   shell_exec("sudo chmod 777 /etc");
   shell_exec("sudo chmod 777 /etc/network");
   shell_exec("sudo cp /etc/network/interfaces /home/pi/Desktop/vAlert/bin/interfacesBackup &");
   shell_exec("sudo cp /home/pi/Desktop/vAlert/bin/vAlert8.exe /home/pi/Desktop/vAlert/bin/vAlert8Bak.exe");
   shell_exec("sudo cp /home/pi/Desktop/vAlert/bin/vAlert8.cfg /home/pi/Desktop/vAlert/bin/vAlert8Cfg.bak &");
   shell_exec("sudo cp /home/pi/Desktop/vAlert/bin/vAlert8Common.cfg /home/pi/Desktop/vAlert/bin/vAlert8Commoncfg.bak &");
   alert('Success','../index.php?item=file');
   function alert($message,$url){
    echo "<script>alert('".$message."');</script>";
    echo "<script>location.href = '".$url."'</script>";
   }
  ?>