From 234f22117f34c48a928fdf4354fe0bf5cb589418 Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 6 Jun 2021 20:49:09 +0100 Subject: [PATCH] Remove file_move_config (deprecated) --- includes/functions.php | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index 0b1a11c4..93c609a3 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -270,28 +270,6 @@ function file_get_meta($filename, $pattern) } } -/** - * Renames an openvpn client config with the 'filename' header comment - * - * @param string file - * @return boolean - */ -function file_move_config($file) -{ - if(file_exists($file)) { - $file_data = file_get_contents($file); - preg_match('/^#\sfilename\s(.*)/i', $file_data, $matched); - $renamed = pathinfo($file, PATHINFO_DIRNAME).'/'. - $matched[1] .'_'.pathinfo($file, PATHINFO_FILENAME).'.'. - pathinfo($file, PATHINFO_EXTENSION); - if (!file_exists($renamed)) { - $return = system("sudo mv $file $renamed", $return); - } else { - return false; - } - } -} - /** * Callback function for array_filter *