Pull Submit

This commit is contained in:
link
2021-12-06 17:08:36 +08:00
parent 52bd22ab2b
commit 2508a4e07d
17 changed files with 209 additions and 41 deletions

25
shell/assist.sh Normal file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
#update to v0.2.3
version_0_2_3(){
((EUID)) && sudo_cmd="sudo"
#copy file to path
if [ ! -s "/etc/udev/rules.d/11-usb-mount.rules" ]; then
$sudo_cmd cp /casaOS/server/shell/11-usb-mount.rules /etc/udev/rules.d/
fi
if [ ! -s "/casaOS/util/shell/usb-mount.sh" ]; then
$sudo_cmd cp /casaOS/server/shell/usb-mount.sh /casaOS/util/shell/
$sudo_cmd chmod +x /casaOS/util/shell/usb-mount.sh
fi
if [ ! -s "/etc/systemd/system/cp /casaOS/server/shell/usb-mount@.service" ]; then
$sudo_cmd cp /casaOS/server/shell/usb-mount@.service /etc/systemd/system/
fi
}
version_0_2_3

View File

@@ -60,7 +60,7 @@ show() {
}
run_external_script() {
show 0 "run_external_script"
assist.sh
}
update() {

View File

@@ -1,6 +1,6 @@
#!/bin/sh
# copy to /oasis/util/shell path
# copy to /casaOS/util/shell path
# chmod 755
log="logger -t usb-mount.sh -s "
@@ -18,10 +18,10 @@ MOUNT_POINT=$(mount | grep ${DEVICE} | awk '{ print $3 }')
do_mount() {
if [[ -n ${MOUNT_POINT} ]]; then
if [ -n "${MOUNT_POINT}" ]; then
${log} "Warning: ${DEVICE} is already mounted at ${MOUNT_POINT}"
exit 1
fib
fi
# Get info for this drive: $ID_FS_LABEL and $ID_FS_TYPE
eval $(blkid -o udev ${DEVICE} | grep -i -e "ID_FS_LABEL" -e "ID_FS_TYPE")

View File

@@ -4,5 +4,5 @@ Description=Mount USB Drive on %i
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/oasis/util/shell/usb-mount.sh add %i
ExecStop=/oasis/util/shell/usb-mount.sh remove %i
ExecStart=/casaOS/util/shell/usb-mount.sh add %i
ExecStop=/casaOS/util/shell/usb-mount.sh remove %i