Clonezilla自定义ocs bash脚本在ocs onsefly命令上失败

Clonezilla自定义ocs bash脚本在ocs onsefly命令上失败,bash,clonezilla,Bash,Clonezilla,我正在做一个定制的clonezilla。。一个用于源将本地磁盘发送到ocs上的远程磁盘上的服务器。。。那家定制的业主立案法团运作良好 但是,由于某些原因,目的地的自定义ocs不起作用。。问题是最后一行“/usr/sbin/ocs ontfly-s$src\u ip-t$dest\u disk”。。出于某种原因,clonezilla在这一行犹豫了,并给出了用法/帮助输出,而不是运行命令 关于ocs onthefly命令为什么不接受这些参数,你有什么想法吗?参数是正确的。如果您在efly-s192.

我正在做一个定制的clonezilla。。一个用于源将本地磁盘发送到ocs上的远程磁盘上的服务器。。。那家定制的业主立案法团运作良好

但是,由于某些原因,目的地的自定义ocs不起作用。。问题是最后一行“/usr/sbin/ocs ontfly-s$src\u ip-t$dest\u disk”。。出于某种原因,clonezilla在这一行犹豫了,并给出了用法/帮助输出,而不是运行命令

关于ocs onthefly命令为什么不接受这些参数,你有什么想法吗?参数是正确的。如果您在efly-s192.168.150.1-tsda上运行“/usr/sbin/ocs”,则运行正常

目标脚本的自定义ocs位于此处:

同时尝试代码块:

#!/bin/bash
# Author: Steven Shiau <steven _at_ nchc org tw>
# License: GPL
# Ref: http://sourceforge.net/forum/forum.php?thread_id=1759263&forum_id=394751
# In this example, it will allow your user to use clonezilla live to choose 
# (1) backup the image of /dev/hda1 (or /dev/sda1) to /dev/hda5 (or /dev/sda5)
# (2) restore image in /dev/hda5 (or /dev/sda5) to /dev/hda1 (or /dev/sda1)

# When this script is ready, you can run
# ocs-iso -g en_US.UTF-8 -k NONE -s -m ./custom-ocs
# to create the iso file for CD/DVD. or
# ocs-live-dev -g en_US.UTF-8 -k NONE -s -c -m ./custom-ocs
# to create the zip file for USB flash drive.

# Begin of the scripts:
# Load DRBL setting and functions
DRBL_SCRIPT_PATH="${DRBL_SCRIPT_PATH:-/usr/share/drbl}"

. $DRBL_SCRIPT_PATH/sbin/drbl-conf-functions
. /etc/drbl/drbl-ocs.conf
. $DRBL_SCRIPT_PATH/sbin/ocs-functions

# load the setting for clonezilla live.
[ -e /etc/ocs/ocs-live.conf ] && . /etc/ocs/ocs-live.conf
# Load language files. For English, use "en_US.UTF-8".
ask_and_load_lang_set en_US.UTF-8

# The above is almost necessary, it is recommended to include them in your own custom-       ocs.
# From here, you can write your own scripts.

# functions
decide_sda_or_hda() {
  if [ -n "$(grep -Ew sda1 /proc/partitions)" ]; then
   disk=sda
  elif [ -n "$(grep -Ew hda1 /proc/partitions)" ]; then
   disk=hda
  else
    [ "$BOOTUP" = "color" ] && $SETCOLOR_FAILURE
    echo "No hard disk detected!"
    echo "Program terminated!"
    [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL
  fi
  # src_part: hda1 or sda1, tgt_part: hda5 or sda5
  dest_disk=${disk}
}

##################
###### MAIN ######
##################

# Set network on destination workstation 1

# Determine if active link then set act_eth

while [ -z "$(/sbin/mii-tool 2>/dev/null | awk -F ":" '/link ok/ {print $1}')" ]; do
    dialog --title "NO LINK!!" --msgbox "\n Need an active link in order to continue!!" 6 50
done

act_eth=`/sbin/mii-tool 2>/dev/null | awk -F ":" '/link ok/ {print $1}'` 

# Set IP Address of destination workstation 1
/sbin/ifconfig $act_eth 192.168.150.2 netmask 255.255.255.0 up
/sbin/route add default gw 192.168.150.254
/bin/echo "nameserver 8.8.8.8" >> /etc/resolv.conf

# Find the disk device
decide_sda_or_hda

# Prompt for IP address of source disk

OUTPUT="./input.txt"
>$OUTPUT
dialog --title "Need SOURCE IP" --inputbox "Enter IP address of the SOURCE server: " 8 60 2>$OUTPUT
src_ip=$(<$OUTPUT)

# Ready the destination disk to receive from source (source should already be waiting in clonezilla), and contact source to start transfer to destination

/usr/sbin/ocs-onthefly -s $src_ip -t $dest_disk
#/bin/bash
#作者:萧国伟
#许可证:GPL
#参考:http://sourceforge.net/forum/forum.php?thread_id=1759263&forum_id=394751
#在本例中,它将允许用户使用clonezilla live进行选择
#(1)将/dev/hda1(或/dev/sda1)的映像备份到/dev/hda5(或/dev/sda5)
#(2)将/dev/hda5(或/dev/sda5)中的映像恢复到/dev/hda1(或/dev/sda1)
#此脚本准备好后,您可以运行
#ocs iso-g en_US.UTF-8-k NONE-s-m/定制ocs
#为CD/DVD创建iso文件。或
#ocs live dev-g en_US.UTF-8-k NONE-s-c-m./custom ocs
#为USB闪存驱动器创建zip文件。
#脚本的开头:
#加载DRBL设置和功能
DRBL_SCRIPT_PATH=“${DRBL_SCRIPT_PATH:-/usr/share/DRBL}”
. $DRBL_脚本_路径/sbin/DRBL conf函数
. /etc/drbl/drbl-ocs.conf
. $DRBL_脚本_路径/sbin/ocs功能
#加载clonezilla live的设置。
[-e/etc/ocs/ocs-live.conf]&&&/etc/ocs/ocs-live.conf
#加载语言文件。对于英语,请使用“en_US.UTF-8”。
询问并加载已设置的语言。UTF-8
#以上内容几乎是必需的,建议您将它们包含在自己的自定义ocs中。
#从这里,您可以编写自己的脚本。
#功能
决定(sda)或(hda){
如果[-n“$(grep-Ew sda1/proc/partitions)”;则
磁盘=sda
elif[-n“$(grep-Ew hda1/proc/partitions)”;然后
磁盘=hda
其他的
[“$BOOTUP”=“color”]&&&$SETCOLOR\u失败
echo“未检测到硬盘!”
echo“程序终止!”
[“$BOOTUP”=“color”]&&&$SETCOLOR\u NORMAL
fi
#src_零件:hda1或sda1,tgt_零件:hda5或sda5
dest_disk=${disk}
}
##################
######主要######
##################
#在目标工作站1上设置网络
#确定是否激活链接,然后设置act_eth
而[-z“$(/sbin/mii-tool 2>/dev/null | awk-F):“'/link-ok/{print$1}')”;做
对话框--标题“无链接!!”--msgbox“\n需要活动链接才能继续!!”6 50
完成
act_eth=`/sbin/mii tool 2>/dev/null | awk-F:“'/link ok/{print$1}'”
#设置目标工作站1的IP地址
/sbin/ifconfig$act_eth 192.168.150.2网络掩码255.255.255.0以上
/sbin/路由添加默认gw 192.168.150.254
/bin/echo“nameserver 8.8.8.8”>>/etc/resolv.conf
#查找磁盘设备
决定是sda还是hda
#提示输入源磁盘的IP地址
OUTPUT=“./input.txt”
>$OUTPUT
对话框--标题“需要源IP”--inputbox“输入源服务器的IP地址:”8 60 2>$OUTPUT

src_ip=$(看起来您的
ocs ontfly
命令得到了意外的参数。要进行分析,请查看带有

 echo /usr/sbin/ocs-onthefly -s $src_ip -t $dest_disk
或者,也许更好,使用

 bash -x script

将告诉您出了什么问题。

看起来您的
ocs最近收到了意外的参数。要进行分析,请使用

 echo /usr/sbin/ocs-onthefly -s $src_ip -t $dest_disk
或者,也许更好,使用

 bash -x script
我会告诉你怎么了