add options to skip flashmemory plugin installation and show help
This commit is contained in:
parent
1259e40134
commit
46d32984cc
45
install
45
install
@ -21,6 +21,7 @@ fi
|
|||||||
declare -l codename
|
declare -l codename
|
||||||
declare -l omvCodename
|
declare -l omvCodename
|
||||||
declare -l omvInstall=""
|
declare -l omvInstall=""
|
||||||
|
declare -i skipFlash=0
|
||||||
declare -i version
|
declare -i version
|
||||||
|
|
||||||
cpuFreqDef="/etc/default/cpufrequtils"
|
cpuFreqDef="/etc/default/cpufrequtils"
|
||||||
@ -42,6 +43,28 @@ if [ -f /etc/armbian-release ]; then
|
|||||||
. /etc/armbian-release
|
. /etc/armbian-release
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
while getopts "fh" opt; do
|
||||||
|
echo "option ${opt}"
|
||||||
|
case "${opt}" in
|
||||||
|
f)
|
||||||
|
skipFlash=1
|
||||||
|
;;
|
||||||
|
h)
|
||||||
|
echo "Use the following flags:"
|
||||||
|
echo " -f"
|
||||||
|
echo " to skip the installation of the flashmemory plugin"
|
||||||
|
echo ""
|
||||||
|
echo "Examples:"
|
||||||
|
echo " install"
|
||||||
|
echo " install -f"
|
||||||
|
exit 100
|
||||||
|
;;
|
||||||
|
\?)
|
||||||
|
echo "Invalid option: -${OPTARG}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
echo "Updating repos before installing..."
|
echo "Updating repos before installing..."
|
||||||
apt-get update
|
apt-get update
|
||||||
|
|
||||||
@ -180,19 +203,23 @@ for service in log2ram armbian-ramlog; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# install flashmemory plugin
|
# install flashmemory plugin unless disabled
|
||||||
echo "Install folder2ram..."
|
if [ ${skipFlash} -eq 1 ]; then
|
||||||
if apt-get --yes --fix-missing --no-install-recommends install folder2ram; then
|
echo "Skipping installation of the flashmemory plugin."
|
||||||
|
else
|
||||||
|
echo "Install folder2ram..."
|
||||||
|
if apt-get --yes --fix-missing --no-install-recommends install folder2ram; then
|
||||||
echo "Installed folder2ram."
|
echo "Installed folder2ram."
|
||||||
else
|
else
|
||||||
echo "Failed to install folder2ram."
|
echo "Failed to install folder2ram."
|
||||||
fi
|
fi
|
||||||
sleep 5
|
sleep 5
|
||||||
echo "Install flashmemory plugin..."
|
echo "Install flashmemory plugin..."
|
||||||
if apt-get --yes install openmediavault-flashmemory; then
|
if apt-get --yes install openmediavault-flashmemory; then
|
||||||
echo "Installed flashmemory plugin."
|
echo "Installed flashmemory plugin."
|
||||||
else
|
else
|
||||||
echo "Failed to install flashmemory plugin."
|
echo "Failed to install flashmemory plugin."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# change default OMV settings
|
# change default OMV settings
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user