Checked scripts for syntax errors using shellcheck.
This commit is contained in:
parent
8a4c5fd6d7
commit
27b9bee38b
|
@ -19,14 +19,13 @@ genIso=$(which genisoimage) ## Iso maker
|
|||
clear
|
||||
if [[ $xyphr == "" ]] || [[ $sysLnx == "" ]] || \
|
||||
[[ $squash == "" ]] || [[ $genIso == "" ]]; then
|
||||
echo "## Missing some packages ##"
|
||||
echo "Xephyr :" "${xyphr}"
|
||||
echo "Syslinux :" "${sysLnx}"
|
||||
echo "Squashfs-tools :" "${squash}"
|
||||
echo "Genisoimage :" "${genIso}"
|
||||
echo ""
|
||||
echo "Going to run :"
|
||||
echo " apt-get install xserver-xephyr syslinux squashfs-tools genisoimage -y"
|
||||
echo -e "## Missing some packages ##\n" \
|
||||
"Xephyr :" "${xyphr}\n" \
|
||||
"Syslinux :" "${sysLnx}\n" \
|
||||
"Squashfs-tools :" "${squash}\n" \
|
||||
"Genisoimage :" "${genIso}\n" \
|
||||
"Going to run :\n" \
|
||||
" apt-get install xserver-xephyr syslinux squashfs-tools genisoimage -y"
|
||||
sleep 4
|
||||
apt-get install xserver-xephyr syslinux squashfs-tools genisoimage -y
|
||||
getIso
|
||||
|
@ -93,20 +92,15 @@ main() {
|
|||
sleep 4
|
||||
getIso
|
||||
elif [[ "${list}" != "" ]] && [ -d squashfs-root ]; then
|
||||
ANSR=""
|
||||
while [[ $ANSR != "1" ]] && [[ $ANSR != "2" ]] && [[ $ANSR != "3" ]]; do
|
||||
clear
|
||||
echo -e "Both an iso and squashfs-root are present...\n"
|
||||
"Which do you wish to use?"
|
||||
read -p "1.) $(echo ./*.iso)
|
||||
2.) Use former session: squashfs-root
|
||||
3.) Exit
|
||||
--> : " ANSR
|
||||
while [[ $ANSR != "1" ]] && [[ $ANSR != "2" ]] && \
|
||||
[[ $ANSR != "3" ]]
|
||||
do
|
||||
read -p "1.) $(echo ./*.iso)
|
||||
2.) Use former session: squashfs-root
|
||||
3.) Exit
|
||||
--> : " ANSR
|
||||
"Which do you wish to use?\n" \
|
||||
"1.) $(echo ./*.iso)\n" \
|
||||
"2.) Use former session: squashfs-root\n" \
|
||||
"3.) Exit"
|
||||
read -p "--> : " ANSR
|
||||
done
|
||||
|
||||
if [[ $ANSR == "1" ]]; then
|
||||
|
@ -124,7 +118,8 @@ main() {
|
|||
chrootr
|
||||
elif [[ "${list}" != "" ]]; then
|
||||
clear
|
||||
echo "Iso(s) found. Will mount one and copying to proper file structure. Then will chroot in..."
|
||||
echo -e "Iso(s) found. Will mount one and copying to proper file structure.\n" \
|
||||
"Then will chroot in..."
|
||||
sleep 4
|
||||
mountAndCopy
|
||||
chrootr
|
||||
|
@ -137,13 +132,20 @@ mountAndCopy() {
|
|||
|
||||
## Prep filesystem
|
||||
isoList=($(find . -maxdepth 1 -name "*.iso" -printf '%P\n'))
|
||||
count="${#isoList[@]}"
|
||||
ANSR=""
|
||||
|
||||
while [[ "${ANSR}" > "${count}" || "${ANSR}" < "0" ]]; do
|
||||
x=0;
|
||||
clear
|
||||
for i in "${isoList[@]}"; do
|
||||
echo "$x - ${i}"
|
||||
((x++))
|
||||
done
|
||||
echo "Chose the ISO from above using the number."
|
||||
read -p "-->: " ANSR
|
||||
done
|
||||
|
||||
echo "You chose : ${isoList[$ANSR]}"
|
||||
mount -o loop ./"${isoList[$ANSR]}" mnt/
|
||||
cp -r mnt/. iso/ && \
|
||||
|
@ -189,15 +191,12 @@ setConfigs() {
|
|||
sed -i 14s/Ubuntu/"${lvUSER}"/g squashfs-root/etc/casper.conf
|
||||
sed -i 5,7s/ubuntu/"${lvUSER}"/g squashfs-root/etc/casper.conf
|
||||
|
||||
|
||||
## Recreate manifest and clean it Note: MUST be after all setting changes
|
||||
chroot squashfs-root/ dpkg-query -W --showformat="${Package} ${VERSION}\n" | sudo tee iso/casper/filesystem.manifest
|
||||
cp -v iso/casper/filesystem.manifest iso/casper/filesystem.manifest-desktop
|
||||
for i in $REMOVE
|
||||
do
|
||||
for i in $REMOVE; do
|
||||
sed -i "/${i}/d" iso/casper/filesystem.manifest-desktop
|
||||
done
|
||||
|
||||
genSqush
|
||||
}
|
||||
|
||||
|
@ -218,6 +217,8 @@ genSqush() {
|
|||
genIsoImg() {
|
||||
## Generate Iso
|
||||
cd iso/
|
||||
sudo mkisofs -D -r -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ../"${NAME}".iso .
|
||||
sudo mkisofs -D -r -cache-inodes -J -l -b isolinux/isolinux.bin -c \
|
||||
isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o \
|
||||
../"${NAME}".iso .
|
||||
}
|
||||
rootNisoChk
|
||||
|
|
Loading…
Reference in New Issue