update plg files, add wakeonlan

This commit is contained in:
Derek Macias
2015-12-30 03:00:11 -07:00
parent 21e2742a77
commit 90b6066975
9 changed files with 24 additions and 70 deletions

View File

@ -1,19 +0,0 @@
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
NerdPack: Nerd Tools unRAID Plugin
NerdPack:
NerdPack: unRAID plugin wrapper for extra packages, mostly CLI, for advanced
NerdPack: users. Use at your own risk. Not officially supported by LimeTech.
NerdPack:
NerdPack: Supports: apr, apt-util, bwm-ng, cpio, git, iftop, inotify, iotop,
NerdPack: iperf, kbd, lftp, lshw, neon, p7zip, perl, python, readline, screen,
NerdPack: sshfs-fuse, strace, subversion, unrar, utempter, vim
NerdPack:
NerdPack: plugin: https://github.com/dmacias72/unRAID-plugins
NerdPack: packages: https://github.com/eschultz/unraid6-nerdpack

View File

@ -1,5 +0,0 @@
<?php
$filename = "/boot/config/plugins/NerdPack/packages/".$_POST["pkg"];
if (is_file($filename));
unlink($filename);
?>

View File

@ -1,38 +0,0 @@
<?php
$pkg_path="/boot/config/plugins/NerdPack/packages/";
$pkg_git = "https://raw.githubusercontent.com/eschultz/unraid6-nerdpack/master/packages/";
$pkg_name = $_POST["pkgnew"];
$pkg_new = $pkg_path.$pkg_name;
$pkg_config = "/boot/config/plugins/NerdPack/NerdPack.cfg";
$pkg_cfg = parse_ini_file($pkg_config); // get package configs
$pkg_pref = $pkg_cfg[$_POST["pkgname"]]; // get package preference
$pkg_old = $pkg_path.$_POST["pkgold"];
$pkg_msg = "$pkg_name package download failed.";
if (file_put_contents($pkg_new, fopen($pkg_git.$pkg_name, 'r')));{
$pkg_size = filesize($pkg_new);
$pkg_handle = fopen($pkg_new, "rb");
$pkg_contents = fread($pkg_handle, $pkg_size);
fclose($pkg_handle);
//shell_exec("cd $pkg_path && wget -q $pkg_new");
$pkg_str = "blob ".$pkg_size."\0".$pkg_contents;
$pkg_sha = sha1($pkg_str);
if($pkg_sha == $_POST["pkgsha"]) {
$pkg_msg = "$pkg_name package downloaded.";
if (is_file($pkg_old))
unlink($pkg_old);
if($pkg_pref == "yes") {
$pkg_cmd = "upgradepkg --install-new ";
$pkg_cmd = $pkg_cmd.$pkg_new." | logger -tnerdpack";
shell_exec($pkg_cmd);
$pkg_msg = "$pkg_name package updated.";
}
}else {
if (is_file($pkg_new))
unlink($pkg_new);
}
}
echo json_encode($pkg_msg);
?>