lördag 18 april 2015

LInux - Debian - How to mount an ISO file in Linux?




















tried to install all the files with a small script I built but something went wrong and iso got fucked up. done now i now..
pack up iso or burn to a disc

Linux - Debian - Extract iso file to folder... works in termial ...

was kind of drunk /high but works great... not sexy code..
but 'm newbie


function ALL-INSTALLED-PACKAGES () {
AllInstalledPackagesSavePath=$(whiptail --inputbox "Where To Save Created Script:?" 8 78 "/home/hynt/" --title "Enter like ex. /home/hynt/backup/" 3>&1 1>&2 2>&3)
cat /etc/apt/sources.list >> /$AllInstalledPackagesSavePath/sources.list
sudo dpkg --get-selections | awk '$2 ~ /^install$/ {print $1}' > /$AllInstalledPackagesSavePath/installed
sort $AllInstalledPackagesSavePath/installed | uniq -u >> /$AllInstalledPackagesSavePath/installed
awk '{print "sudo apt-get -y --force-yes --allow-unauthenticated --ignore-missing install --reinstall " $0}' < /$AllInstalledPackagesSavePath/installed > $AllInstalledPackagesSavePath/installed-package-installer-`date +%Y-%m-%d`.sh
perl -pi -e 'print "sudo cp sources.list /etc/apt/ && sudo apt-get update\n" if $.==1' /$AllInstalledPackagesSavePath/installed-package-installer-`date +%Y-%m-%d`.sh
perl -pi -e 'print "#! /bin/bash\n" if $.==1' $AllInstalledPackagesSavePath/installed-package-installer-`date +%Y-%m-%d`.sh
echo "sudo apt-get dist-upgrade" >> /$AllInstalledPackagesSavePath/installed-package-installer-`date +%Y-%m-%d`.sh
chmod u=rwx,g=rx,o=r /$AllInstalledPackagesSavePath/installed-package-installer-`date +%Y-%m-%d`.sh
sleep 2
rm $AllInstalledPackagesSavePath/installed
sudo echo echo "hynten@speed-mailer.com" >> $AllInstalledPackagesSavePath/installed-package-installer-`date +%Y-%m-%d`.sh
red "RESTART-SCRIPT" ; RESTART-SCRIPT ; sleep 4
}
#-----------------------------------------------


function DPKG-REPACK () {
whiptail --title "DPKG-REPACK" --msgbox "All Installed Packages create repack 2 *.deb files script" 8 78
repackSavePath=$(whiptail --inputbox "Where To Save Created Script:?" 8 78 "/home/hynt/" --title "Enter like ex. /home/hynt/backup/" 3>&1 1>&2 2>&3)
dpkg -l | awk '{print $2}' | sed "s/^/\ fakeroot -u dpkg-repack /; s/$/\ /;" > /$repackSavePath/repack-all-packages-`date +%Y-%m-%d`.sh
sed '1,6d' < /$repackSavePath/repack-all-packages-`date +%Y-%m-%d`.sh > /$repackSavePath/repack-all-package-`date +%Y-%m-%d`.sh 
rm /$repackSavePath/repack-all-packages-`date +%Y-%m-%d`.sh
chmod u=rwx,g=rx,o=r /$repackSavePath/repack-all-package-`date +%Y-%m-%d`.sh
}

function SCAN-PACKAGES-2-DVD () {
ScanPackages2DvdPath=$(whiptail --inputbox "Scanpackages To Make Your Own Deb dvd/cd?" 8 78 "/home/snort/deb/" --title "Enter like ex. /home/snort/deb/" 3>&1 1>&2 2>&3)
ScanPackages2DvdName=$(whiptail --inputbox "Give me a name to give to the iso file?" 8 78 "MyDebFiles-`date +%Y-%m-%d`" --title "Enter like ex. MyDebFiles-`date +%Y-%m-%d`" 3>&1 1>&2 2>&3)
cd /$ScanPackages2DvdPath/ ; dpkg-scanpackages -m . /dev/null | gzip -9c > Packages.gz
#cd /$ScanPackages2DvdPath/ ; mv *.sh ../      #flytta inte installerar med den

genisoimage -r -o /$ScanPackages2DvdPath/$ScanPackages2DvdName.iso /$ScanPackages2DvdPath/
whiptail --title "All done!" --msgbox "Burn it with your favorite burn program and run apt-cdrom add" 8 78
}




Inga kommentarer: