-#Create and serve multiple Shaarlis (farm)
Example bash script (creates multiple shaarli instances and generates an HTML index of them)
```bash
ref="master"
#clone multiple shaarli instances
-if [ ! -d "$shaarli_base_dir" ]; then mkdir "$shaarli_base_dir"; fi[](.html)
+if [ ! -d "$shaarli_base_dir" ]; then mkdir "$shaarli_base_dir"; fi
for account in $accounts; do
- if [ -d "$shaarli_base_dir/$account" ];[](.html)
- then echo "[info] account $account already exists, skipping";[](.html)
- else echo "[info] creating new account $account ..."; git clone --quiet "$shaarli_repo_url" -b "$ref" "$shaarli_base_dir/$account"; fi[](.html)
+ if [ -d "$shaarli_base_dir/$account" ];
+ then echo "[info] account $account already exists, skipping";
+ else echo "[info] creating new account $account ..."; git clone --quiet "$shaarli_repo_url" -b "$ref" "$shaarli_base_dir/$account"; fi
done
#generate html index of shaarlis
for account in $accounts; do accountlinks="$accountlinks\n<li><a href=\"$account\">$account</a></li>"; done
-if [ -d "$shaarli_base_dir/index.html" ]; then echo "[removing old index.html]"; rm "$shaarli_base_dir/index.html" ]; fi[](.html)
-echo "[info] generating new index of shaarlis"[](.html)
+if [ -d "$shaarli_base_dir/index.html" ]; then echo "[removing old index.html]"; rm "$shaarli_base_dir/index.html" ]; fi
+echo "[info] generating new index of shaarlis"
echo -e "$htmlhead $accountlinks $htmlfooter" > "$shaarli_base_dir/index.html"
-echo '[info] done.'[](.html)
-echo "[info] list of accounts: $accounts"[](.html)
-echo "[info] contents of $shaarli_base_dir:"[](.html)
+echo '[info] done.'
+echo "[info] list of accounts: $accounts"
+echo "[info] contents of $shaarli_base_dir:"
tree -a -L 1 "$shaarli_base_dir"
```
-This script just serves as an example. More precise or complex (applying custom configuration, etc) automation is possible using configuration management software like [Ansible](https://www.ansible.com/)[](.html)
+This script just serves as an example. More precise or complex (applying custom configuration, etc) automation is possible using configuration management software like [Ansible](https://www.ansible.com/)
\ No newline at end of file