Script `nc-shares` - list shares on command line

This script lists shares much more clearly than the sharelisting app, which only outputs in json or csv format.
Anyone who needs a quick overview of their shares will certainly be well served with this tool.

I have been using this tool myself for a very long time. However, now I have integrated it into the same framework as my other published scripts. So it uses the same modules, which simplifies publishing as only a module loader is needed. The modules all build on each other, so the wheel doesn’t have to be reinvented for each script.

Installation of the script:

sudo wget -qO /usr/local/bin/nc-shares https://global-social.net/script/nc-shares
sudo chmod +x /usr/local/bin/nc-shares
Explanation:
  • the first line downloads the script into the directory /usr/local/bin
  • the second line makes it executable

You only need to install it once.
As all of my scripts it is modular, comes signed and does an integrity check on the first run for the script and checks the hash of the loaded modules on every startup.

Here the help screen (may change in future):

user@box:~# nc-shares -h

  Usage:  nc-shares [-s|--sharetype=(0-13)] -- user|all
          nc-shares -h|--help

  Options:                     (* = default value)
         -h --help               help (print this help information)
         -s --sharetype=[0-13]   A number from 0 to 13, meaning:
                                  0 = user
                                  1 = group
                                 (2 = usergroup Internal type used by DefaultShareProvider)
                                * 3 = link (default)
                                  4 = email
                                  5 = contact (ToDo Check if it is still in use otherwise remove it)
                                  6 = remote
                                  7 = circle
                                  8 = guest
                                  9 = remote group
                                 10 = room
                                (11 = userroom Internal type used by RoomShareProvider)
                                 12 = deck
                                (13 = deck user Internal type used by DeckShareProvider)

         user                    nextcloud user
         all                     all nextcloud users

  examples:
  list all shares from all users shared with groups
         nc-shares -s 1 -- all
  list all link-shares from user "Max"
         nc-shares Max

Feedback and suggestions for improvements/additions are always welcome!


Good luck,
ernolf

2 Likes