mcrapet / plowshare

Command-line tool and engine for managing sharing websites
GNU General Public License v3.0
850 stars 88 forks source link

Issues with installation directory #53

Closed chienb closed 8 years ago

chienb commented 8 years ago

I'm getting the error below when using plowdown on my server:

2016-06-07 00:10:12 - Plowdown path set as: /usr/bin/plowdown
2016-06-07 00:10:12 - Cmd: /usr/bin/plowdown --max-retries=5 --no-plowsharerc --timeout=60 --temp-rename --output-directory=/home/admin/web/filesparq.com/public_html/files/_tmp/ -a xxx@gmail.com:xxx http://rapidgator.net/file.avi.html 2>&1
2016-06-07 00:10:12 - [0;31m-------------------------------------------------------------------------------
Your plowshare installation has currently no module.
(/usr/share/httpd/.config/plowshare/modules.d/ is empty)

In order to use plowdown you must install some modules. Here is a quick start:
$ plowmod --install
-------------------------------------------------------------------------------[0m
[0;33mOutput directory: /home/admin/web/filesparq.com/public_html/files/_tmp[0m
[0;31mplowdown: unknown command-line option `-a`[0m

Plowmod --status gives me the following:

grep: /usr/share/plowshare/modules\/config: No such file or directory
grep: /root/.config/plowshare/modules.d/legacy\/config: No such file or directory
grep: /root/.config/plowshare/modules.d/legacy.git\/config: No such file or directory

I SSH into the server to double check and the files and folders are all there so I'm not sure what's going on. I also don't get why it's looking in/usr/share/httpd/...

mcrapet commented 8 years ago

Hi, What is your BASH version ? What is the result of this command: plowmod -v3 --no-color -i

chienb commented 8 years ago

GNU bash, version 4.2.46(1)-release (x86_64-redhat-linux-gnu)

plowmod: adding legacy (default) repository: https://github.com/mcrapet/plowshare-modules-legacy.git
dbg: modules directory: /root/.config/plowshare/modules.d
- installing new directory: /root/.config/plowshare/modules.d/legacy.git
ERROR: directory exists but it does not appear to be a git repository, abort
mcrapet commented 8 years ago

Using plowshare as root is usually a bad idea (for security). Do this: rm -f /root/.config/plowshare/modules.d plowmod -v3 --no-color -i

chienb commented 8 years ago

[root@filesparq ~]# rm -f /root/.config/plowshare/modules.d rm: cannot remove ‘/root/.config/plowshare/modules.d’: Is a directory

mcrapet commented 8 years ago

Sorry it's rm -rf /root/.config/plowshare/modules.d

chienb commented 8 years ago
plowmod: adding legacy (default) repository: https://github.com/mcrapet/plowshare-modules-legacy.git
dbg: modules directory: /root/.config/plowshare/modules.d
- installing new directory: /root/.config/plowshare/modules.d/legacy.git
mcrapet commented 8 years ago

What's the result of: plowmod --no-color -v3 -s

Plowshare should work, for example: plowdown --no-color -v3 --modules

chienb commented 8 years ago

Plowdown works, outputs a list of filehosts.

However for plowmod --no-color -v3 -s

dbg: modules directory: /root/.config/plowshare/modules.d
grep: /usr/share/plowshare/modules\/config: No such file or directory
grep: /root/.config/plowshare/modules.d/legacy.git\/config: No such file or directory
-------------------------------------------------------------------------------
Your plowshare installation has currently no module.
(/root/.config/plowshare/modules.d/ is empty)

In order to use plowdown you must install some modules. Here is a quick start:
$ plowmod --install
mcrapet commented 8 years ago

This is a Bash issue!

On Bash 4.3.42:

$ declare -a ARR=(a b c)
$ echo "${ARR[@]}"
a b c
$ echo "${ARR[@]/%/\/end}"
a/end b/end c/end

On Bash 4.2.37:

$ declare -a ARR=(a b c)
$ echo "${ARR[@]}"
a b c
$ echo "${ARR[@]/%/\/end}"
a\/end b\/end c\/end

Thanks for reporting, I'll fix it!

mcrapet commented 8 years ago

Issue was only in plowmod. You can update your Plowshare sources (git repository) to have the fix.