1.5-rc-3
This commit is contained in:
+16
-1
@@ -7,6 +7,13 @@ xzname=$imgname.xz
|
||||
sizes=sizes-$imgname-$xzame.txt
|
||||
checksums=sha256sum-$imgname-$xzname.sha256
|
||||
|
||||
# get real username (not root) if run with sudo
|
||||
if [ ! -z $SUDO_USER ]; then
|
||||
username=$SUDO_USER
|
||||
else
|
||||
username=$USER
|
||||
fi
|
||||
|
||||
lsblk
|
||||
echo "Enter disk name (including /dev/) ex /dev/sdb"
|
||||
read dadisk
|
||||
@@ -18,13 +25,21 @@ webhook "Copied the disk to $imgname ($imgsize), compressing to $xzname"
|
||||
sudo pishrink.sh -v -Z -a $imgname
|
||||
xzsize=$(du -h $xzname)
|
||||
|
||||
webhook "$imgname ($imgsize) shrunk to $xzname ($xzsize), calculating sha256 checksums..." true
|
||||
webhook "$imgname ($imgsize) shrunk to $xzname ($xzsize), calculating sha256 checksums..."
|
||||
sha256sum $imgname | tee $checksums
|
||||
sha256sum $xzname | tee -a $checksums
|
||||
|
||||
webhook "getting sizes"
|
||||
echo -e "imgsize: $imgsize\nxzsize: $xzsize" | tee $sizes
|
||||
|
||||
echo "changing perms"
|
||||
sudo chown $username:$username $xzname
|
||||
|
||||
webhook "testing archive $xzname"
|
||||
xz -t $xzname
|
||||
ret=$?
|
||||
webhook "test status: $ret"
|
||||
|
||||
webhook "DONE\n\tdisk: $dadisk\n\timgname: $imgname ($imgsize)\n\txzname: $xzname ($xzsize)" true
|
||||
sudo shutdown -r +1
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user