immortalwrt/package/lean/luci-app-docker/root/etc/docker-init

20 lines
377 B
Plaintext
Raw Normal View History

2020-03-17 21:09:04 +08:00
#!/bin/sh
dtype=`fdisk -l /dev/sda | grep 'Disklabel type' | awk '{print $3}'`
partid="0"
if [ "$dtype" = "gpt" ]
then
partid=`echo "n
w
" | fdisk /dev/sda | grep 'Created a new partition' | awk '{print $5}'`
elif [ "$dtype" = "dos" ]
then
partid=`echo "n
p
w
" | fdisk /dev/sda | grep 'Created a new partition' | awk '{print $5}'`
fi
echo "y" | mkfs.ext4 /dev/sda$partid