From d06850d4d56b30f533d7ecf6ebcccbe5f312186c Mon Sep 17 00:00:00 2001 From: dmacias72 Date: Fri, 11 Mar 2016 19:20:27 -0700 Subject: [PATCH] convert shellinabox to cmdline --- plugins/cmdline.plg | 5 ++- .../{shellinabox-plugin.png => cmdline.png} | Bin .../{shellinabox-plugin.xml => cmdline.xml} | 14 ++++-- plugins/shellinabox-plugin.plg | 41 ++++++++++++++---- 4 files changed, 46 insertions(+), 14 deletions(-) rename plugins/{shellinabox-plugin.png => cmdline.png} (100%) rename plugins/{shellinabox-plugin.xml => cmdline.xml} (76%) diff --git a/plugins/cmdline.plg b/plugins/cmdline.plg index 4013872f..cdac9724 100755 --- a/plugins/cmdline.plg +++ b/plugins/cmdline.plg @@ -159,13 +159,14 @@ else if [ -f $OLDPLG/home_directory.tar.gz ]; then mv -f $OLDPLG/home_directory.tar.gz &plgPATH;/home_directory.tar.gz fi - if [ -d "$OLDPLG" ]; then + if [ -d $OLDPLG ]; then rm -rf $OLDPLG fi if [ -f $OLDPLG.plg ]; then rm -rf $OLDPLG.plg + rm -f /var/log/plugins/shellinabox-plugin.plg fi - + # upgrade package upgradepkg --install-new &plgPATH;/&plgNAME;.txz diff --git a/plugins/shellinabox-plugin.png b/plugins/cmdline.png similarity index 100% rename from plugins/shellinabox-plugin.png rename to plugins/cmdline.png diff --git a/plugins/shellinabox-plugin.xml b/plugins/cmdline.xml similarity index 76% rename from plugins/shellinabox-plugin.xml rename to plugins/cmdline.xml index 694b703f..70635df4 100644 --- a/plugins/shellinabox-plugin.xml +++ b/plugins/cmdline.xml @@ -5,14 +5,20 @@ dmacias72 False Tools:System -Shell In A Box +Command Line -Shell In A Box implements a web server that can export arbitrary command line tools to a web based terminal emulator. A Command Line tool is created under the Tools menu. +Command Line implements Shell In A Box. A web server that can export arbitrary command line tools to a web based terminal emulator. A Command Line tool is created under the Tools menu. Backup and restore user home directory on system shutdown and start. Also includes screenfetch for command line screenshots. http://lime-technology.com/forum/index.php?topic=42683.0 -https://raw.githubusercontent.com/dmacias72/unRAID-plugins/master/plugins/shellinabox-plugin.png -2016-02-20 +https://raw.githubusercontent.com/dmacias72/unRAID-plugins/master/plugins/cmdline.png +2016-03-11 +###2016.03.11 +- add connect button on settings page +- add setting button on tools page +- rename plugin to cmdline since it is more than just shellinabox +- fix: conform screenfetch OS: to 80 columns (remove brackets) +- condense and restructure code ###2016.02.20 - fix: update plugin ovewriting home directory with saved ###2016.02.11a diff --git a/plugins/shellinabox-plugin.plg b/plugins/shellinabox-plugin.plg index b80839c9..cdac9724 100755 --- a/plugins/shellinabox-plugin.plg +++ b/plugins/shellinabox-plugin.plg @@ -1,10 +1,10 @@ + - - + + @@ -20,6 +20,12 @@ This Plugin installs and controls shellinabox for unRaid 6.1 All dependencies a --> +###2016.03.11 +- add connect button on settings page +- add setting button on tools page +- rename plugin to cmdline since it is more than just shellinabox +- fix: conform screenfetch OS: to 80 columns (remove brackets) +- condense and restructure code ###2016.02.20 - fix: update plugin ovewriting home directory with saved ###2016.02.11a @@ -95,6 +101,7 @@ This Plugin installs and controls shellinabox for unRaid 6.1 All dependencies a SERVICE="disable" SSL="disable" SCREEN="disable" +BACKUP="disable" IPADDR="disable" PORT="4200" RUNAS="nobody" @@ -138,11 +145,28 @@ if [ "${sum1:0:32}" != "${sum2:0:32}" ]; then rm &plgPATH;/&plgNAME;.md5 exit 1 else - #remove old plugin name directory + #remove old plugin and move old files + OLDPLG="/boot/config/plugins/shellinabox-plugin" if [ -d /usr/local/emhttp/plugins/shellinabox ]; then rm -rf /usr/local/emhttp/plugins/shellinabox fi - + if [ -d /usr/local/emhttp/plugins/shellinabox-plugin ]; then + rm -rf /usr/local/emhttp/plugins/shellinabox-plugin + fi + if [ -f $OLDPLG/shellinabox-plugin.cfg ]; then + mv -f $OLDPLG/shellinabox-plugin.cfg &plgPATH;/cmdline.cfg + fi + if [ -f $OLDPLG/home_directory.tar.gz ]; then + mv -f $OLDPLG/home_directory.tar.gz &plgPATH;/home_directory.tar.gz + fi + if [ -d $OLDPLG ]; then + rm -rf $OLDPLG + fi + if [ -f $OLDPLG.plg ]; then + rm -rf $OLDPLG.plg + rm -f /var/log/plugins/shellinabox-plugin.plg + fi + # upgrade package upgradepkg --install-new &plgPATH;/&plgNAME;.txz @@ -189,19 +213,20 @@ echo "" - + > "$CFGFILE" [ ! `cat "$CFGFILE" | grep SCREEN` ] && echo "SCREEN=\"disable\"" >> "$CFGFILE" +[ ! `cat "$CFGFILE" | grep BACKUP` ] && echo "BACKUP=\"disable\"" >> "$CFGFILE" [ ! `cat "$CFGFILE" | grep SSL` ] && echo "SSL=\"disable\"" >> "$CFGFILE" [ ! `cat "$CFGFILE" | grep IPADDR` ] && echo "IPADDR=\"disable\"" >> "$CFGFILE" [ ! `cat "$CFGFILE" | grep ^PORT` ] && echo "PORT=\"4200\"" >> "$CFGFILE" [ ! `cat "$CFGFILE" | grep RUNAS` ] && echo "RUNAS=\"nobody\"" >> "$CFGFILE" -rm /tmp/shellinabox-chkconf +rm /tmp/cmdline-chkconf ]]>