]> ========================================================================= README ========================================================================= Credits: ************** Great thanks go to Limetech for giving us unRAID. To the ProFTPD project for their feature rich ftp server and the icon I used for this plugin. Further thanks go to PhAzE. This Plugin uses a lot of his code he did for his plugins. Please check them out, they are really great! Also to Overbyrn, Benni-Chan, Influencer, prostuff1, speeding_ant and bonienl for their great plugins. Studying their code was what made this plugin possible. ************** HOWTO: I wanted to keep this plugin as simple as possible. So there is no fancy user- or servermanagement. The plugin provides you with the ability to define ftp-only users and assign them their own home directory, which they won't be able to leave. Of course it is possible to assign the same directory to more than one user. So, how do you do it? You open the unRAID user management and choose add user. Then you choose username and password like you usually would. The difference is in the description field, what I guess you would normally leave empty. Into this field you put "ftpuser /path/to/homedir/of/user" without the quotes and save. Then please restart the proftp daemon. The daemon start script will now scan all users. Every user without the "ftpuser" keyword in the description field will be put into an ftpusers file. This files contains users who are not allowed to access the ftp server. I know this is a somewhat strange logic. :) Then the path to the user directory given in the description will be extracted and put into the root field of the user file. unRAID doesn't expose this field on its users page and normally fills it with / which would give all users access to all files on your server. You are now able to do something like: user user1 ftpuser user2 ftpuser /mnt/cache/FTP user3 ftpuser /mnt/cache/FTP/dir_a user4 ftpuser /mnt/cache/FTP/dir_b user will not be able to login via ftp user1 will have full access to / user2 will have access to all files in /mnt/cache/FTP so he will be able to access the files in dir_a and dir_b, too. user3 will have access to dir_a and subdirectories but not to /mnt/cache/FTP or dir_b user4 will have access to dir_b and subdirectories but not to /mnt/cache/FTP or dir_a If you don't want to give users full access to your system but only to specific shares or directories, you can mount those to another dir and set this as the homedir for ftp access as described above. Mount and unmount commands should be placed in the mountscript.sh and unmountscript.sh files in the plugins directory. Examples on how to do that, are given in those files. So, what if this is not enough for you? Well, for a more fine grained control you may edit the /etc/proftpd.conf file. If you have a webserver with php installed and enabled, please point the plugin to its port and webroot. The plugin config page will then provide you with an editor for the proftpd.conf file. If not, you'll have to edit it in shell directly. By adding directory entries you'll have a powerful weapon to fulfill your needs. Have a look at: http://www.proftpd.org/docs/howto/Directory.html for further explanation. Bans, quotas, sftp, tls, sql users* and more may be possible. The proftpd included in my plugin was compiled with the following modules: mod_auth.c mod_quotatab.c mod_auth_file.c mod_quotatab_file.c mod_auth_unix.c mod_quotatab_sql.c* mod_ban.c mod_readme.c mod_cap.c mod_rewrite.c mod_core.c mod_sftp.c mod_ctrls.c mod_sftp_sql.c* mod_ctrls_admin.c mod_site.c mod_delay.c mod_sql.c* mod_facts.c mod_sql_mysql.c* mod_ident.c mod_sql_passwd.c* mod_log.c mod_tls.c mod_ls.c mod_xfer.c * only if sql package is installed In the future it may be possible to get php and sql based user and server management tools to work. Feel free to try and please report and share your findings. SlrG --> ###2021-03-31 - version 1.6a : Removed deprecated config directive from default configuration. (thanks kricker!) ###2021-03-29 - version 1.6 : Bumped ProFTPd version for 64 bit systems to v1.3.7a and fixed some permission and ownership problems in packages (thanks ljm42!). ###2020-03-10.1 - version 1.5a : Fix typo. ###2020-03-10 - version 1.5 : Fix mount and unmount scripts not beeing run from flash. ###2019-05-26 - version 1.4a : Fix bug in dependency version. ###2019-05-23 - version 1.4 : Recompile of ProFTPd to work on unRAID 6.7. It probably will break compatibility for older versions. ###2018-02-05.1 - version 1.3c : Fixed bug introduced by latest icon location change. ###2018-02-05 - version 1.3b : Changed icon location for unRAID 6.4 compatibility. ###2017-07-19 - version 1.3a : Fixed reference to old config editor. ###2017-07-12 - version 1.3 : Bumped ProFTPd version for 64 bit systems to v1.3.6 and fixed install bug when unRAIDs internel webserver is disabled. ###2016-06-06 - version 1.2b : Fixed stupid error in rc.ProFTPd - version 1.2a : Fixed mod_lang error and ConfigEditor installation problem. ###2016-06-05 - version 1.2 : Bumped ProFTPd version for 64 bit systems to v1.3.6rc2. ###2015-12-21 - version 1.1b : Add creation of locale folder to fix config saving in the config editor and fix proftpd.delay problem. ###2015-12-11 - version 1.1a : Fix persistance of mountscript and unmountscript and bumped ProFTPd version for 64 bit systems to v1.3.6rc1. ###2015-09-14 - version 1.1 : Fix startscripts for unRAID 6.1 compatibility. ###2015-05-03 - version 1.0a : Add information about mountscript.sh and unmountscript.sh to ProFTPd-README and README. ###2015-03-22 - version 1.0 : Re-written based on PhAzEs v2 plugins to run with Unraid 6 Plugin Manager. ###2013-12-28 - version 0.5k : Removed SimpleFeatures recognition and added manual webserver configuration. ###2013-11-13 - version 0.5j : Added scripts to mount directories on array start and unmount them on array stop. - version 0.5i : Fixed refresh of control panel plugin by adding sudo -u root to restart of inetd. ###2013-11-08 - version 0.5h : Downgraded openssl to 0.9.8n because 1.0.1c was creating problems with other plugins using the older version. (Thanks Madhouse!) ###2013-07-17 - version 0.5g : Fixed problem that slashes were removed from proftpd.conf on save and removed unnecessary sudo commands. (Thanks Necrotic!) ###2013-05-28 - version 0.5f : Move binary files from github to personal webspace and change version check. - version 0.5e : Fixed openssl dependency. ###2013-05-27 - version 0.5d : Fixed error message when no SimpleFeatures webserver is installed. ###2013-05-23 - version 0.5c : Change of wordings. - version 0.5b : Disable FTP Server icon of unRAIDs internal ftp server. (Thanks saary!) - version 0.5a : Fixed stupid bug that blocked the downloading of files from the github repo. (Thanks saary!) ###2013-04-04 - version 0.5 : Added syntax checking and line numbering to config file editor. ###2013-03-29 - version 0.4 : Update functionality for plugin (Thanks overbyrn!). ###2013-03-23 - version 0.3 : Provide config editor in iframe if simplefeatures webserver is available. ###2013-02-08 - version 0.2 : Check if sql is installed and choose proftpd package accordingly. ###2013-02-02 - version 0.1a : Enable download of iconfiles if not yet present. (Thanks overbyrn!) ###2013-02-01 - version 0.1 : First release # Server Settings ServerName ProFTPd ServerType standalone DefaultServer on PidFile &pid; # Port 21 is the standard FTP port. You propably should not connect to the # internet with this port. Make your router forward another port to # this one instead. Port 21 # Set the user and group under which the server will run. User nobody Group users # Prevent DoS attacks MaxInstances 30 # Speedup Login UseReverseDNS off IdentLookups off # Control Logging - comment and uncomment as needed # If logging Directory is world writeable the server won't start! # If no SystemLog is defined proftpd will log to servers syslog. #SystemLog NONE #SystemLog &plg;/slog TransferLog NONE #TransferLog &plg;/xferlog WtmpLog NONE # As a security precaution prevent root and other users in # /etc/ftpuser from accessing the FTP server. UseFtpUsers on RootLogin off # Umask 022 is a good standard umask to prevent new dirs and files # from being group and world writable. Umask 022 # "Jail" FTP-Users into their home directory. (chroot) # The root directory has to be set in the description field # when defining an user: # ftpuser /mnt/cache/FTP # See README for more information. DefaultRoot ~ # Shell has to be set when defining an user. As a security precaution # it is set to "/bin/false" as FTP-Users should not have shell access. # This setting makes proftpd accept invalid shells. RequireValidShell no # Normally, we want files to be overwriteable. AllowOverwrite on # &name; configuration: SERVICE="disable" WEBSRV="disable" WPATH="" WPORT="" #!/bin/bash # put your commands for creating mount points and mounting here # they will be executed when the array starts # e.g.: # mkdir /mnt/cache/FTP/movies;mount --bind /mnt/user0/movies /mnt/cache/FTP/movies #!/bin/bash # put your commands for unmounting and removing mount points here # they will be executed when the array stops # e.g.: # umount /mnt/cache/FTP/movies;rmdir /mnt/cache/FTP/movies # ========================================================================= # Clean up previous files that don't match the known md5 # ========================================================================= # Setup plugin variables CTRLFILES="/boot/config/plugins/&name;/&controlFILE;" CFGFILE="/boot/config/plugins/&name;/&name;.cfg" OLDNAME="proftpd" # Backwards compatibility from older SlrG plugins, they had lower case folders and extra files in the bundle # Note that it is done this way because Unraid 6 is case insensitive and we only want it to execute if lower case was found DIREXISTS=`find "/boot/config/plugins" -type d -maxdepth 1 | grep "$OLDNAME"` if [ "$DIREXISTS" == "/boot/config/plugins/$OLDNAME" ]; then [ -f "/etc/rc.d/rc.$OLDNAME" ] && "/etc/rc.d/rc.$OLDNAME" stop && rm -f "/etc/rc.d/rc.$OLDNAME" /bin/sed -i -e "/vsftpd$/s/#ftp/ftp/" /etc/inetd.conf mv -f "/boot/config/plugins/$OLDNAME" "/boot/config/plugins/$OLDNAME-temp" mkdir "/boot/config/plugins/&name;" if [ -f "/boot/config/plugins/${OLDNAME}-temp/${OLDNAME}.cfg" ]; then mv -f "/boot/config/plugins/${OLDNAME}-temp/${OLDNAME}.cfg" "/boot/config/plugins/&name;/" fi if [ -f "/boot/config/plugins/${OLDNAME}-temp/${OLDNAME}.conf" ]; then mv -f "/boot/config/plugins/${OLDNAME}-temp/${OLDNAME}.conf" "/boot/config/plugins/&name;/" fi sed -i "s_^PidFile.*_PidFile &pid;_g" "/boot/config/plugins/&name;/${OLDNAME}.conf" rm -rf "/boot/config/plugins/$OLDNAME-temp" [ -d "/usr/local/emhttp/plugins/$OLDNAME" ] && rm -rf "/usr/local/emhttp/plugins/$OLDNAME" if [ "x86_64" == "$ARCHTYPE" ]; then if [ -f "/boot/config/plugins/${OLDNAME}_v6.plg" ]; then /usr/local/sbin/plugin remove "${OLDNAME}_v6.plg" fi fi fi # Since this is a universal plugin for unraid, check if running 32 bit or 64 bit OS for dependencies ARCHTYPE=$( /usr/bin/uname -m ) if [ "x86_64" == "$ARCHTYPE" ]; then DEPFILES="/boot/config/plugins/&name;/&dependencyFILE64;" DEPMD5="&dependencyMD564;" DEPURL="&dependencyURL64;" else DEPFILES="/boot/config/plugins/&name;/&dependencyFILE;" DEPMD5="&dependencyMD5;" DEPURL="&dependencyURL;" echo " " # This makes unraid 5 console a little cleaner fi # Backwards compatibility from older plugin versions echo "Cleaning up previous install files..." # delete file but don't warn if file does not exist rmNoWarn() { test -e $1 && rm $1 2>/dev/null } # delete directory but don't warn if directory does not exist rmRecursiveNoWarn() { test -e $1 && rm -r $1 2>/dev/null } #One-time remove of legacy packages from previous plugin versions #Selfremoval commands echo "Executing selfremoval commands if present..." #rmNoWarn &plg;/filename; sed -i '/#srmtag00001/d' &pld;/&name;.plg # Example for selfremoval commands sed -i '/^IdentLookups/d' &plg;/proftpd.conf; sed -i '/#srmtag00002/d' &pld;/&name;.plg # remove deprecated configuration directive from existing configs # Verifies plugin control files if they exist, deletes if they are incorrect so new ones can be downloaded if [ -f "$CTRLFILES" ]; then MD5TEST=`echo "&controlMD5; $CTRLFILES" | md5sum --quiet --status -c - && echo "1" || echo "0"` if [ "$MD5TEST" == "0" ]; then echo -e "\t Found wrong version of plugin control files. Deleting" rm -f "$CTRLFILES" else echo -e "\t Found correct version of plugin control files. Ignoring" fi fi # Verifies plugin dependency files if they exist, deletes if they are incorrect so new ones can be downloaded if [ -f "$DEPFILES" ]; then MD5TEST=`echo "$DEPMD5 $DEPFILES" | md5sum --quiet --status -c - && echo "1" || echo "0"` if [ "$MD5TEST" == "0" ]; then echo -e "\t Found wrong version of plugin dependency files. Deleting" rm -f "$DEPFILES" else echo -e "\t Found correct version of plugin dependency files. Ignoring" fi fi # Remove previous temp install directory if found [ -d /tmp/&name;-inst ] && rm -fR /tmp/&name;-inst; echo "...Cleanup complete!" # ========================================================================= # Download required plugin files # ========================================================================= echo "Downloading any missing plugin files..." # Check for net connectivity to the repo, 5 second timeout then fails NETCHECK=`timeout 5 wget --no-check-certificate -qST4 --spider "https://github.com/&author;" 2>&1 | grep HTTP | tail -1 | cut -f1 | awk '{print $NF}'` if [ "$NETCHECK" == "OK" ]; then HASNET="yes" else HASNET="no" fi # Downloads plugin control files if they don't exist, then verify them if [ ! -f "$CTRLFILES" ]; then echo -e "\t Latest plugin control files downloading" if [ "$HASNET" == "yes" ]; then mkdir -p "/boot/config/plugins/&name;" wget --no-check-certificate -qO "$CTRLFILES" "&controlURL;" if [ -f "$CTRLFILES" ]; then MD5TEST1=`echo "&controlMD5; $CTRLFILES" | md5sum --quiet --status -c - && echo "1" || echo "0"` if [ "$MD5TEST1" == "1" ]; then echo -e "\t Plugin control files have passed MD5 check" else echo "...Downloaded plugin control files have failed MD5 check. Deleting and aborting install" rm -f "$CTRLFILES" rm -f "/tmp/&name;-script" exit 1 fi else echo "...Unable to download missing plugin control files. Aborting install" rm -f "/tmp/&name;-script" exit 1 fi else echo "...Unable to download missing plugin control files. Aborting install" rm -f "/tmp/&name;-script" exit 1 fi fi # Downloads plugin dependency files if they don't exist, then verify them if [ ! -f "$DEPFILES" ] && [ "$DEPMD5" != "" ]; then echo -e "\t Latest plugin dependency files downloading" if [ "$HASNET" == "yes" ]; then mkdir -p /boot/config/plugins/&name; wget --no-check-certificate -qO "$DEPFILES" "$DEPURL" if [ -f "$DEPFILES" ]; then MD5TEST2=`echo "$DEPMD5 $DEPFILES" | md5sum --quiet --status -c - && echo "1" || echo "0"` if [ "$MD5TEST2" == "1" ]; then echo -e "\t Plugin dependency files have passed MD5 check" else echo "...Downloaded plugin dependency files have failed MD5 check. Deleting and aborting install" rm -f "$DEPFILES" rm -f "/tmp/&name;-script" exit 1 fi else echo "...Unable to download missing plugin dependency files. Aborting install" rm -f "/tmp/&name;-script" exit 1 fi else echo "...Unable to download missing plugin dependency files. Aborting install" rm -f "/tmp/&name;-script" exit 1 fi fi # Removes other packages that don't match the version required, leaves out the proper ones if they exist find /boot/config/plugins/&name;/&name;-&author;-Control* -type f -not -name "&controlFILE;" 2> /dev/null | xargs rm 2> /dev/null if [ "x86_64" == "$ARCHTYPE" ]; then find /boot/config/plugins/&name;/&name;-&author;-Dependency* -type f -not -name "&dependencyFILE64;" 2> /dev/null | xargs rm 2> /dev/null else find /boot/config/plugins/&name;/&name;-&author;-Dependency* -type f -not -name "&dependencyFILE;" 2> /dev/null | xargs rm 2> /dev/null fi echo "...Downloading complete!" # ============================================== # The 'install' script # ============================================== echo "Running install script for &displayName;..." # Verify the elements in the plugin default config file, add any that are missing if [ ! -f "$CFGFILE" ]; then mkdir -p "/boot/config/plugins/&name;" echo -e "\t No default config file found. Creating" echo "# &displayName; configuration:" > "$CFGFILE" fi [ ! `cat "$CFGFILE" | grep SERVICE` ] && echo "SERVICE=\"disable\"" >> "$CFGFILE" [ ! `cat "$CFGFILE" | grep WEBSRV` ] && echo "WEBSRV=\"disable\"" >> "$CFGFILE" [ ! `cat "$CFGFILE" | grep WPATH` ] && echo "WPATH=\"\"" >> "$CFGFILE" [ ! `cat "$CFGFILE" | grep WPORT` ] && echo "WPORT=\"\"" >> "$CFGFILE" # Extract and install the plugin support files from the tar.gz file echo -e "\t Installing plugin control files" if [ -f "$CTRLFILES" ]; then mkdir -p "/tmp/&name;-inst/install-A" TEMP1="/tmp/&name;-inst/install-A/usr/local/emhttp/plugins/&name;" tar -xf "$CTRLFILES" -C "/tmp/&name;-inst/install-A" if [ "x86_64" == "$ARCHTYPE" ]; then echo "---" >> "${TEMP1}/&name;.page" echo "<?php include '/usr/local/emhttp/plugins/&name;/styles/&name;6.css';?>" >> "${TEMP1}/&name;.page" echo "<?php include '/usr/local/emhttp/plugins/&name;/include/&name;.php';?>" >> "${TEMP1}/&name;.page" else echo "<?php include '/usr/local/emhttp/plugins/&name;/styles/&name;5.css';?>" > "${TEMP1}/&name;.php" echo "<?php include '/usr/local/emhttp/plugins/&name;/include/&name;.php';?>" >> "${TEMP1}/&name;.php" fi cp -Raf "/tmp/&name;-inst/install-A/." / [ -e "/etc/rc.d/rc.&name;" ] && rm -f "/etc/rc.d/rc.&name;" ln -s "&pls;/rc.&name;" "/etc/rc.d/rc.&name;" else echo "...Install failed, no plugin control files located. Exiting" rm -f "/tmp/&name;-script" exit 1 fi # Extract and install the plugin dependency files from the tar.gz file if [ "$DEPMD5" != "" ]; then echo -e "\t Installing plugin dependency files" if [ -f "$DEPFILES" ]; then mkdir -p "/tmp/&name;-inst/install-B" [ ! -d "&commonDIR;/var/log/setup/tmp" ] && mkdir -p "&commonDIR;/var/log/setup/tmp" tar -xf "$DEPFILES" -C "/tmp/&name;-inst/install-B" # Detect if MySQL/MariaDB is installed echo -e "\t Detect if MySQL/MariaDB is installed..." if [ -d "/usr/lib/mysql" ] || [ -d "/usr/lib64/mysql" ]; then [ -f "/tmp/&name;-inst/install-B/&name;.tgz" ] && rm -f "/tmp/&name;-inst/install-B/&name;.tgz" [ -f "/tmp/&name;-inst/install-B/&name;-x86_64.tgz" ] && rm -f "/tmp/&name;-inst/install-B/&name;-x86_64.tgz" else [ -f "/tmp/&name;-inst/install-B/&name;-sql.tgz" ] && rm -f "/tmp/&name;-inst/install-B/&name;*sql*.tgz" [ -f "/tmp/&name;-inst/install-B/&name;-sql-x86_64.tgz" ] && rm -f "/tmp/&name;-inst/install-B/&name;-sql-x86_64.tgz" fi echo -e "\t Move Config Editor archive to plugin dir..." # Copy Config Editor to plugin dir [ -f "/tmp/&name;-inst/install-B/ConfEdit.tar.gz" ] && cp -f --no-preserve mode,ownership "/tmp/&name;-inst/install-B/ConfEdit.tar.gz" "&plg;/" && rm -f "/tmp/&name;-inst/install-B/ConfEdit.tar.gz" ROOT="&commonDIR;" upgradepkg --install-new /tmp/&name;-inst/install-B/* if [ ! -f "/usr/share/curl/ca-bundle.crt" ] && [ -f "&commonDIR;/usr/share/curl/ca-bundle.crt" ]; then mkdir -p "/usr/share/curl" cp -f "&commonDIR;/usr/share/curl/ca-bundle.crt" "/usr/share/curl/ca-bundle.crt" fi else echo "...Install failed, no plugin dependency files located. Exiting" rm -f "/tmp/&name;-script" exit 1 fi fi # Correct any ^M (Windows carriage characters) in the important files [ -f "/usr/local/emhttp/plugins/&name;/scripts/rc.&name;" ] && sed -i 's!\r!!g' "/usr/local/emhttp/plugins/&name;/scripts/rc.&name;" [ -d "/usr/local/emhttp/plugins/&name;/event" ] && sed -i 's!\r!!g' /usr/local/emhttp/plugins/&name;/event/* # Create /usr/local/var if it doesn't exist [ ! -d "/usr/local/var" ] && mkdir /usr/local/var # Create proftpd.delay if it doesn't exist [ ! -f "/usr/local/var/proftpd.delay" ] && touch /usr/local/var/proftpd.delay # Symlink /usr/local/share/locale if it doesn't exist [ ! -d "/usr/local/share/locale" ] && ln -s &commonDIR;/usr/local/share /usr/local/share #detect if run on boot if [[ -n $(sed -n '/^ftp/p' /etc/inetd.conf) ]]; then echo "Disable builtin FTP-Server..." /bin/sed -i -e "s/^ftp/##ftp/" /etc/inetd.conf echo "Restart inetd to apply change..." /usr/bin/sudo -u root /etc/rc.d/rc.inetd restart # v6 if [ -f "/usr/local/emhttp/webGui/FTP.page" ]; then echo "Disable icon of builtin FTP-Server..." mv /usr/local/emhttp/webGui/FTP.page /usr/local/emhttp/webGui/FTP.page.bak fi # v5 if [ -f "/usr/local/emhttp/plugins/webGui/FTP.page" ]; then echo "Disable icon of builtin FTP-Server..." mv /usr/local/emhttp/plugins/webGui/FTP.page /usr/local/emhttp/plugins/webGui/FTP.page.bak fi fi if [ ! -f "/etc/proftpd.conf" ]; then echo "Remove example config file..." [ -f "&commonDIR;/usr/local/etc/proftpd.conf" ] && rm &commonDIR;/usr/local/etc/proftpd.conf echo "Symlink new config file..." [ -f "&plg;/proftpd.conf" ] && /bin/ln -s &plg;/proftpd.conf /etc/proftpd.conf fi &pls;/rc.&name; start # Remove the temp install folder echo -e "\t Cleaning up temp files/folders" rm -Rf "/tmp/&name;-inst" echo "...Install complete!" rm -f "/tmp/&name;-script" ARCHTYPE=$( /usr/bin/uname -m ) if [ "x86_64" == "$ARCHTYPE" ]; then # ============================================== # The 'remove' script # ============================================== CFGFILE="/boot/config/plugins/&name;/&name;.cfg" echo "Uninstalling $displayName; plugin..." sleep 1 # Stop the app if the control file exists [ -f "&pls;/rc.&name;" ] && &pls;/rc.&name; stop sleep 1 # Unjail users &pls;/rc.&name; unjail # Check if ConfigEditor is installed and remove it... source "$CFGFILE" if [ "$WEBSRV" == "enable" ] && [ "$WPATH" != "" ]; then [ -d "$WPATH/&name;" ] && rm -fR "$WPATH/&name;" fi #Reenable builtin FTP-Server if [[ -n $(sed -n '/^##ftp/p' /etc/inetd.conf) ]]; then echo "Enable builtin FTP-Server..." /bin/sed -i -e "s/^##ftp/ftp/" /etc/inetd.conf echo "Restart inetd to apply change..." /usr/bin/sudo -u root /etc/rc.d/rc.inetd restart fi # v6 if [ -f "/usr/local/emhttp/webGui/FTP.page.bak" ]; then echo "Enable icon of builtin FTP-Server..." mv /usr/local/emhttp/webGui/FTP.page.bak /usr/local/emhttp/webGui/FTP.page fi # v5 if [ -f "/usr/local/emhttp/plugins/webGui/FTP.page.bak" ]; then echo "Enable icon of builtin FTP-Server..." mv /usr/local/emhttp/plugins/webGui/FTP.page.bak /usr/local/emhttp/plugins/webGui/FTP.page fi if [ -f "/etc/proftpd.conf" ]; then echo "Remove config file..." rm /etc/proftpd.conf fi # Get the arch type to see what version of unraid is running ARCHTYPE=$( /usr/bin/uname -m ) # Remove all files and directories pertaining to this plugin if [ "$(find &commonDIR; -type f | grep startcfg.sh | wc -l 2> /dev/null)" == "0" ]; then rm -Rf "&commonDIR;" fi # Clear /usr/local/var from plugin files [ -f /usr/local/var/proftpd.* ] && rm -f /usr/local/var/proftpd.* [[ -L "/usr/local/share" && -d "/usr/local/share" ]] && rm -f /usr/local/share [ -d "/usr/local/emhttp/plugins/&name;" ] && rm -fR "/usr/local/emhttp/plugins/&name;" [ -f "/etc/rc.d/rc.&name;" ] && rm -f "/etc/rc.d/rc.&name;" [ -e "/var/log/plugins/&name;.plg" ] && rm -f "/var/log/plugins/&name;.plg" [ -d "/boot/config/plugins/&name;" ] && rm -fR "/boot/config/plugins/&name;" [ -f "/boot/config/plugins/&name;.plg.old" ] && rm -f "/boot/config/plugins/&name;.plg.old" if [ "x86_64" != "$ARCHTYPE" ]; then [ -f "/boot/config/plugins/&name;.plg" ] && rm -f "/boot/config/plugins/&name;.plg" fi echo "...Uninstall complete! Please reboot to remove any remaining dependency files." sleep 1 fi rm -f "/tmp/&name;-script"