CasaOS/shell/assist.sh

44 lines
1.1 KiB
Bash
Raw Normal View History

2021-12-06 09:08:36 +00:00
#!/bin/bash
#add in v0.2.3
version_0_2_3() {
2021-12-06 09:08:36 +00:00
((EUID)) && sudo_cmd="sudo"
$sudo_cmd cp -rf /casaOS/server/shell/11-usb-mount.rules /etc/udev/rules.d/
$sudo_cmd chmod +x /casaOS/server/shell/usb-mount.sh
$sudo_cmd cp -rf /casaOS/server/shell/usb-mount@.service /etc/systemd/system/
2021-12-06 09:08:36 +00:00
}
# add in v0.2.5
readonly CASA_DEPANDS="curl smartmontools"
2022-01-24 14:06:31 +00:00
version_0_2_5() {
install_depends "$CASA_DEPANDS"
2022-01-24 09:08:28 +00:00
}
#Install Depends
install_depends() {
((EUID)) && sudo_cmd="sudo"
if [[ ! -x "$(command -v '$1')" ]]; then
show 2 "Install the necessary dependencies: $1"
packagesNeeded=$1
if [ -x "$(command -v apk)" ]; then
$sudo_cmd apk add --no-cache $packagesNeeded
elif [ -x "$(command -v apt-get)" ]; then
$sudo_cmd apt-get -y -q install $packagesNeeded
elif [ -x "$(command -v dnf)" ]; then
$sudo_cmd dnf install $packagesNeeded
elif [ -x "$(command -v zypper)" ]; then
$sudo_cmd zypper install $packagesNeeded
else
show 1 "Package manager not found. You must manually install: $packagesNeeded"
fi
fi
}
version_0_2_3
version_0_2_5