Merge pull request #78 from IceWhaleTech/dev

Dev
This commit is contained in:
link 2022-01-24 17:22:48 +08:00 committed by GitHub
commit 1fd13668c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 192 additions and 258 deletions

View file

@ -33,7 +33,7 @@ func InitRouter() *gin.Engine {
r.GET("/v1/guide/check", v1.GetGuideCheck)
r.GET("/debug", v1.GetSystemConfigDebug)
r.GET("/v1/debug", v1.GetSystemConfigDebug)
//set user
r.POST("/v1/user/setusernamepwd", v1.Set_Name_Pwd)
//get user info

View file

@ -262,7 +262,7 @@ func AddPartition(c *gin.Context) {
c.JSON(http.StatusOK, model.Result{Success: oasis_err.DISK_BUSYING, Message: oasis_err.GetMsg(oasis_err.DISK_BUSYING)})
return
}
if !file.CheckNotExist("/mnt/" + name) {
if !file.CheckNotExist("/DATA/" + name) {
// /mnt/name exist
c.JSON(http.StatusOK, model.Result{Success: oasis_err.NAME_NOT_AVAILABLE, Message: oasis_err.GetMsg(oasis_err.NAME_NOT_AVAILABLE)})
return
@ -279,7 +279,7 @@ func AddPartition(c *gin.Context) {
service.MyService.Disk().AddPartition(path)
}
mountPath := "/mnt/" + name
mountPath := "/DATA/" + name
service.MyService.Disk().MountDisk(path, mountPath)
@ -314,7 +314,7 @@ func PostMountDisk(c *gin.Context) {
path := c.PostForm("path")
serial := c.PostForm("serial")
mountPath := "/mnt/volume"
mountPath := "/DATA/volume"
var list = service.MyService.Disk().GetSerialAll()
var pathMapList = make(map[string]string, len(list))
for _, v := range list {

View file

@ -13,6 +13,8 @@ version_0_2_3() {
readonly CASA_DEPANDS="curl smartmontools"
version_0_2_5{
install_depends "$CASA_DEPANDS"
}

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# copy to /casaOS/util/shell path
# chmod 755
@ -30,23 +30,32 @@ do_mount() {
# Figure out a mount point to use
# LABEL=${ID_FS_LABEL}
LABEL=${DEVBASE}
if grep -q " /mnt/casa_${LABEL} " /etc/mtab; then
# Already in use, make a unique one
LABEL+="-${DEVBASE}"
fi
DEV_LABEL="${LABEL}"
# LABEL=${DEVBASE}
# if grep -q " /DATA/USB_${LABEL} " /etc/mtab; then
# # Already in use, make a unique one
# LABEL+="-${DEVBASE}"
# fi
# DEV_LABEL="${LABEL}"
# Use the device name in case the drive doesn't have label
if [ -z ${DEV_LABEL} ]; then
DEV_LABEL="${DEVBASE}"
fi
# # Use the device name in case the drive doesn't have label
# if [ -z ${DEV_LABEL} ]; then
# DEV_LABEL="${DEVBASE}"
# fi
MOUNT_POINT="/mnt/casa_${DEV_LABEL}"
MOUNT_POINT="/DATA/USB_Storage1"
arr=("/DATA/USB_Storage1" "/DATA/USB_Storage2" "/DATA/USB_Storage3" "/DATA/USB_Storage4" "/DATA/USB_Storage5" "/DATA/USB_Storage6" "/DATA/USB_Storage7" "/DATA/USB_Storage8" "/DATA/USB_Storage9" "/DATA/USB_Storage10" "/DATA/USB_Storage11" "/DATA/USB_Storage12")
for folder in ${arr[@]}; do
#如果文件夹不存在,创建文件夹
if [ ! -d "$folder" ]; then
mkdir -p ${folder}
MOUNT_POINT=$folder
break
fi
done
${log} "Mount point: ${MOUNT_POINT}"
mkdir -p ${MOUNT_POINT}
# # Global mount options
# OPTS="rw,relatime"
@ -84,7 +93,7 @@ do_mount() {
mount -t iso9660 ${DEVICE} ${MOUNT_POINT}
;;
*)
/bin/rmdir "${MOUNT_POINT}"
/bin/rmdir "${MOUNT_POINT}"
exit 0
;;
esac

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long