forked from paukstelis/octoprint_deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugins.sh
More file actions
executable file
·38 lines (33 loc) · 1.13 KB
/
Copy pathplugins.sh
File metadata and controls
executable file
·38 lines (33 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
install_plugin() {
echo "Installing $plugin...."
sudo -u octavia /opt/OctoPrint/bin/pip install "$plugin_path"
}
plugin_menu() {
echo
echo
PS3="${green}Select recommended plugins to install: ${white}"
readarray -t plugins < <(cat ${SCRIPT_DIR}/plugins_list | sed -n -e 's/^plugin:\(.*\) path:.*/\1/p')
plugins+=("All")
plugins+=("Quit")
select plugin in "${plugins[@]}"
do
if [ "$plugin" == Quit ]; then
break
fi
#some special thing to do if All Recommended
if [ "$plugin" == All ]; then
for plugin in "${plugins[@]}"; do
plugin_path=$(cat ${SCRIPT_DIR}/plugins_list | sed -n -e "s/^plugin:$plugin path:\([[:graph:]]*\)/\1/p")
if [ -n "$plugin_path" ]; then
install_plugin $plugin $plugin_path
fi
done
break
fi
#install single plugin
#get plugin path
plugin_path=$(cat ${SCRIPT_DIR}/plugins_list | sed -n -e "s/^plugin:$plugin path:\([[:graph:]]*\)/\1/p")
install_plugin
done
}