Installation of Nextcloud on LEDE (was: Bash to Ash help)

I need help in this aspect as I am not a coder. I am currently evaluating the possibility to install NextCloud on Lede and need guidance to convert a bash shell script into ash. The script is the following:

#!/bin/bash
ocpath='/var/www/nextcloud'
htuser='www-data'
htgroup='www-data'
rootuser='root'

printf "Creating possible missing Directories\n"
mkdir -p $ocpath/data
mkdir -p $ocpath/assets
mkdir -p $ocpath/updater

printf "chmod Files and Directories\n"
find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750
chmod 755 ${ocpath}

printf "chown Directories\n"
chown -R ${rootuser}:${htgroup} ${ocpath}/
chown -R ${htuser}:${htgroup} ${ocpath}/apps/
chown -R ${htuser}:${htgroup} ${ocpath}/assets/
chown -R ${htuser}:${htgroup} ${ocpath}/config/
chown -R ${htuser}:${htgroup} ${ocpath}/data/
chown -R ${htuser}:${htgroup} ${ocpath}/themes/
chown -R ${htuser}:${htgroup} ${ocpath}/updater/

chmod +x ${ocpath}/occ

printf "chmod/chown .htaccess\n"
if [ -f ${ocpath}/.htaccess ]
 then
  chmod 0644 ${ocpath}/.htaccess
  chown ${rootuser}:${htgroup} ${ocpath}/.htaccess
fi
if [ -f ${ocpath}/data/.htaccess ]
 then
  chmod 0644 ${ocpath}/data/.htaccess
  chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess
fi

I also need the script execution for ash. In bash it would be

bash scriptexample.sh

Looks like your script is already ash-compatible.
In order to execute, just do:

sh scriptexample.sh

instead of using bash.

1 Like

@jpt thanks for the guidance, will try and inform back

Ha, also, remove the first line, or replace it with

#!/bin/sh
1 Like

@jpt ok thanks :wink:

Did you managed to install nextcloud? can you share your results?
I am interested in doing that too. I used to have owncloud installed on entware (a repo similar to the one LEDE provides) using lighttpd in earlier versions and later nginx... but could not make the change there to nextcloud (some errors which I did not investigate... I ended up installing it on ubuntu laptop. But now, with a different router and LEDE just installed, I want to install it. I am testing Seafile (which comes in LEDE repo) but so far I find it very slow when access it from the web, compared with owncloud / nextcloud.

Any progress, or may be a issue you want to share is welcomed.

@rodoviario no not yet but plan to do so by the end of the month and will post a step by step guide on how to do such

Hi again... any news on this?

I have tryed in a fresh entware (based on LEDE) to install latest nextcloud... Used latest nginx from repo, php7 and a mix of instructions from different sources, but ended nowhere. :frowning: any guidance or news in the matter is higlhy appreciated.

I am thinking in review the owncloud example files to spot differences and try again.

Thanks in advance

Since this discussion is regarding Nextcloud installation on LEDE, I changed the topic accordingly.

Please mind that there is already a thread about the same topic: Nextcloud on LEDE?