mirror of
https://github.com/akuker/RASCSI.git
synced 2025-01-03 01:33:14 +00:00
Check for webmin module config before modifying
This commit is contained in:
parent
616e11ebe2
commit
a6136c7f4a
@ -948,6 +948,7 @@ function installSamba() {
|
|||||||
# Installs and configures Webmin
|
# Installs and configures Webmin
|
||||||
function installWebmin() {
|
function installWebmin() {
|
||||||
WEBMIN_PATH="/usr/share/webmin"
|
WEBMIN_PATH="/usr/share/webmin"
|
||||||
|
WEBMIN_MODULE_CONFIG="/etc/webmin/netatalk2/config"
|
||||||
WEBMIN_MODULE_VERSION="1.0"
|
WEBMIN_MODULE_VERSION="1.0"
|
||||||
|
|
||||||
if [ -d "$WEBMIN_PATH" ]; then
|
if [ -d "$WEBMIN_PATH" ]; then
|
||||||
@ -968,14 +969,23 @@ function installWebmin() {
|
|||||||
curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh
|
curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh
|
||||||
sudo sh setup-repos.sh
|
sudo sh setup-repos.sh
|
||||||
rm setup-repos.sh
|
rm setup-repos.sh
|
||||||
sudo apt-get install webmin --install-recommends
|
sudo apt-get install webmin --install-recommends </dev/null
|
||||||
echo
|
echo
|
||||||
echo "Downloading and installing Webmin module..."
|
echo "Downloading and installing Webmin module..."
|
||||||
rm netatalk2-wbm.tgz || true
|
if [[ -f "$WEBMIN_MODULE_CONFIG" ]]; then
|
||||||
|
echo "$WEBMIN_MODULE_CONFIG already exists; will not modify..."
|
||||||
|
WEBMIN_MODULE_FLAG=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm netatalk2-wbm.tgz 2> /dev/null || true
|
||||||
wget -O netatalk2-wbm.tgz "https://github.com/Netatalk/netatalk-webmin/releases/download/netatalk2-$WEBMIN_MODULE_VERSION/netatalk2-wbm-$WEBMIN_MODULE_VERSION.tgz" </dev/null
|
wget -O netatalk2-wbm.tgz "https://github.com/Netatalk/netatalk-webmin/releases/download/netatalk2-$WEBMIN_MODULE_VERSION/netatalk2-wbm-$WEBMIN_MODULE_VERSION.tgz" </dev/null
|
||||||
sudo /usr/share/webmin/install-module.pl netatalk2-wbm.tgz
|
sudo "$WEBMIN_PATH/install-module.pl" netatalk2-wbm.tgz
|
||||||
sudo sed -i 's@/sbin@/local/sbin@' /etc/webmin/netatalk2/config
|
|
||||||
rm netatalk2-wbm.tgz
|
if [[ ! $WEBMIN_MODULE_FLAG ]]; then
|
||||||
|
echo "Modifying $WEBMIN_MODULE_CONFIG..."
|
||||||
|
sudo sed -i 's@/usr/sbin@/usr/local/sbin@' "$WEBMIN_MODULE_CONFIG"
|
||||||
|
fi
|
||||||
|
rm netatalk2-wbm.tgz || true
|
||||||
}
|
}
|
||||||
|
|
||||||
# updates configuration files and installs packages needed for the OLED screen script
|
# updates configuration files and installs packages needed for the OLED screen script
|
||||||
|
Loading…
Reference in New Issue
Block a user