khalequzzaman17

CentOS 8 Detection in PHP

Nov 25th, 2021 (edited)
757
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. <?php
  2.  
  3. // checking operating version through rhel
  4. $osVersion = exec("rpm -E %{rhel}");
  5. $lockedvOS = "8";
  6.  
  7. if (file_exists('/etc/letsencrypt-cpanel.osver8')) {
  8.  
  9. //let's compare the strings using strcmp()
  10. if ( strcmp($osVersion, $lockedvOS) == 0 ) {
  11.  echo "Both the strings are equal!";
  12. } else {
  13.   echo "Both the strings are not equal!";
  14. }
  15.  
  16.     // echo "Overriding CentOS 8 's License";
  17. } else {
  18.     // echo "Keep the License of CentOS 7";
  19. }
  20.  
  21. ?>
Add Comment
Please, Sign In to add comment