Clonezilla custom-ocs bash script failing on ocs-onthefly command -
i'm doing custom clonezilla.. 1 source send local disk remote disk ocs-onthefly... custom-ocs working fine.
however, custom-ocs destination reason not working.. problem last line "/usr/sbin/ocs-onthefly -s $src_ip -t $dest_disk" .. reason clonezilla balking @ line , gives usage/help output instead of running command..
any ideas on why ocs-onthefly command not accepting parameters? parameters correct. if run "/usr/sbin/ocs-onthefly -s 192.168.150.1 -t sda" runs fine.
custom-ocs destination script here: https://www.dropbox.com/s/9mfrt0n50sheayn/custom-ocs_destination-revised.txt
attempting code block also:
#!/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 example, allow user use clonezilla live choose # (1) backup image of /dev/hda1 (or /dev/sda1) /dev/hda5 (or /dev/sda5) # (2) restore image in /dev/hda5 (or /dev/sda5) /dev/hda1 (or /dev/sda1) # when script ready, can run # ocs-iso -g en_us.utf-8 -k none -s -m ./custom-ocs # create iso file cd/dvd. or # ocs-live-dev -g en_us.utf-8 -k none -s -c -m ./custom-ocs # create zip file usb flash drive. # begin of scripts: # load drbl setting , 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 setting clonezilla live. [ -e /etc/ocs/ocs-live.conf ] && . /etc/ocs/ocs-live.conf # load language files. english, use "en_us.utf-8". ask_and_load_lang_set en_us.utf-8 # above necessary, recommended include them in own custom- ocs. # here, can write own scripts. # functions decide_sda_or_hda() { if [ -n "$(grep -ew sda1 /proc/partitions)" ]; disk=sda elif [ -n "$(grep -ew hda1 /proc/partitions)" ]; 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 set act_eth while [ -z "$(/sbin/mii-tool 2>/dev/null | awk -f ":" '/link ok/ {print $1}')" ]; dialog --title "no link!!" --msgbox "\n need active link in order 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 /sbin/route add default gw 192.168.150.254 /bin/echo "nameserver 8.8.8.8" >> /etc/resolv.conf # find disk device decide_sda_or_hda # prompt ip address of source disk output="./input.txt" >$output dialog --title "need source ip" --inputbox "enter ip address of source server: " 8 60 2>$output src_ip=$(<$output) # ready destination disk receive source (source should waiting in clonezilla), , contact source start transfer destination /usr/sbin/ocs-onthefly -s $src_ip -t $dest_disk
when test via echo (not within clonezilla on linux box) dialog output $src_ip , $dest_disk outputs variables fine, don't know why ocs-onthefly not accepting it.
looks ocs-onthefly
command getting unexpected arguments. analyze, lets see actual command with
echo /usr/sbin/ocs-onthefly -s $src_ip -t $dest_disk
or, maybe better, result of running script with
bash -x script
will tell wrong.
Comments
Post a Comment