Print this page
XXX Remove nawk(1)


 232                 sr_snap="zbe-$snap_rename_zbe_i"
 233                 (( snap_rename_zbe_i = $snap_rename_zbe_i + 1 ))
 234         elif [[ "$sr_snap" == ~(Er)(_snap[0-9]*) ]]; then
 235                 sr_snap=${sr_snap##~(Er)([0-9]*)}
 236                 sr_snap="${sr_snap}${snap_rename_snap_i}"
 237                 (( snap_rename_snap_i = $snap_rename_snap_i + 1 ))
 238         else
 239                 printf "$f_user_snap\n" >&2
 240                 printf "\t$sr_fs@$sr_snap\n" >&2
 241                 printf "$f_rm_snap\n" >&2
 242                 exit $ZONE_SUBPROC_FATAL
 243         fi
 244 
 245         eval $2="$sr_snap"
 246 }
 247 
 248 # find the dataset associated with $zonepath
 249 uninstall_get_zonepath_ds()
 250 {
 251         ZONEPATH_DS=`/sbin/zfs list -t filesystem -o name,mountpoint | \
 252             /bin/nawk -v zonepath=$zonepath '{
 253                 if ($2 == zonepath)
 254                         print $1
 255         }'`
 256 
 257         if [ -z "$ZONEPATH_DS" ]; then
 258                 # there is no $zonepath dataset
 259                 rm_zonepath
 260                 exit $ZONE_SUBPROC_OK
 261         fi
 262 }
 263 
 264 # find the dataset associated with $ZONEPATH_DS/ROOT
 265 uninstall_get_zonepath_root_ds()
 266 {
 267         ZONEPATH_RDS=`/sbin/zfs list -H -t filesystem -o name \
 268                 $ZONEPATH_DS/ROOT 2>/dev/null`
 269 
 270         if [ -z "$ZONEPATH_RDS" ]; then
 271                 # there is no $ZONEPATH_DS/ROOT dataset
 272                 c=`/sbin/zfs list -H -t filesystem -r $ZONEPATH_DS | wc -l`




 232                 sr_snap="zbe-$snap_rename_zbe_i"
 233                 (( snap_rename_zbe_i = $snap_rename_zbe_i + 1 ))
 234         elif [[ "$sr_snap" == ~(Er)(_snap[0-9]*) ]]; then
 235                 sr_snap=${sr_snap##~(Er)([0-9]*)}
 236                 sr_snap="${sr_snap}${snap_rename_snap_i}"
 237                 (( snap_rename_snap_i = $snap_rename_snap_i + 1 ))
 238         else
 239                 printf "$f_user_snap\n" >&2
 240                 printf "\t$sr_fs@$sr_snap\n" >&2
 241                 printf "$f_rm_snap\n" >&2
 242                 exit $ZONE_SUBPROC_FATAL
 243         fi
 244 
 245         eval $2="$sr_snap"
 246 }
 247 
 248 # find the dataset associated with $zonepath
 249 uninstall_get_zonepath_ds()
 250 {
 251         ZONEPATH_DS=`/sbin/zfs list -t filesystem -o name,mountpoint | \
 252             /usr/xpg4/bin/awk -v zonepath=$zonepath '{
 253                 if ($2 == zonepath)
 254                         print $1
 255         }'`
 256 
 257         if [ -z "$ZONEPATH_DS" ]; then
 258                 # there is no $zonepath dataset
 259                 rm_zonepath
 260                 exit $ZONE_SUBPROC_OK
 261         fi
 262 }
 263 
 264 # find the dataset associated with $ZONEPATH_DS/ROOT
 265 uninstall_get_zonepath_root_ds()
 266 {
 267         ZONEPATH_RDS=`/sbin/zfs list -H -t filesystem -o name \
 268                 $ZONEPATH_DS/ROOT 2>/dev/null`
 269 
 270         if [ -z "$ZONEPATH_RDS" ]; then
 271                 # there is no $ZONEPATH_DS/ROOT dataset
 272                 c=`/sbin/zfs list -H -t filesystem -r $ZONEPATH_DS | wc -l`