View previous topic :: View next topic |
Author |
Message |
maxim.251 Tux's lil' helper
Joined: 14 Jul 2012 Posts: 127
|
Posted: Sat Mar 08, 2014 6:55 pm Post subject: skript of missing_program.sh |
|
|
If you reinstall your system from the beginning.
This script will help you to install all the necessary programs that you previously You have in the old system.
missing_program-1.0.3
dont forgot do "chmod 700 missing_program.sh" in terminal
Code: | #!/bin/bash
# Krzysztof Rogoża
# It is good to check the basic package.
# Also you can utilize this script to install your programs after reinstalling the system.
# thanks to this, you do not have to worry that you forgot to install something.
time=1 #put the time of wait
# in "potrzebne -> needed" You can put names of programs what You want to download and installed.
potrzebne="awk bash konsole genkernel ufed cat coreutils chmod chroot clear cp cut fdisk free grep gparted loadkeys lm_sensors md5sum mkdir mount mv rm sed baobab lynx setterm sha512sum sleep swapoff swapon tar touch tr umount wc wget make pkg-config g++ libncurses5-dev libqt4-dev libqt4-gui libqt4-core " # <--- add here youres programs or delete whatt you do not whant.
ins="echo instaling" # "emerge" or "apt-get install" <- I make "echo" beacouse then You can see how this program is workt. Later you can write emerge (gentoo) or apt-get install (in ubuntu series)
term_p(){
a=$1
export a=$a
echo " now is make + $1"
echo '#!/bin/bash' > /home/com.sh
echo 'echo "wykonanie komendy * $a"'>> /home/com.sh
echo "$ins $1" >> /home/com.sh
echo 'sleep 2' >> /home/com.sh
chmod 700 /home/com.sh
xterm -e "/home/com.sh"
echo " comand finish * $1"
}
emergeProgr(){
term_p $1
#emerge -av $1 #| grep "jest już" #tr -s '[:blank:]' ' '| grep Budowanie #2> /dev/null #??
#echo "test, tak na prawd? teraz nic si? nie intsaluje bezpiecze?stwa"
sleep $((time+1))
}
check_xterm(){
exist_xterm(){
echo ""
which xterm &>/dev/null && (echo " * xterm exists ";sleep 0.5s ) || (echo " x xterm not";echo "xterm" > /home/brakuje_xterm.log; sleep 0.5s )
}
instal_xterm(){
if [ -e /home/brakuje_xterm.log ]
then
$ins xterm
rm /home/brakuje_xterm.log
echo ""
else
echo "xterm exist"
echo""
fi
}
exist_xterm
instal_xterm
}
exist(){
which ${1} &>/dev/null && (echo " * ${1} exists ";sleep 0.5s ) || (echo " x ${1} not";echo ${1} >> /home/brakuje.log; sleep 0.5s )
}
start(){
echo "Looking for missing programs"
sleep 1
for b
in ${potrzebne}
do
exist "${b}"
done
echo ""
sleep $time
}
doinstalowania(){
echo "reading from a file Missing programs "
prog=`cat /home/brakuje.log`
for zs
in $prog
do
echo "this program is missing --: $zs"
sleep 0.5s
done
}
instal(){
echo "Instaling package start"
sleep 0.5s
for zm
in $prog
do
echo "instaling $zm"
sleep 0.5s
emergeProgr $zm #instaling from list $prog
done
echo "Instaling is finish"
rm /home/brakuje.log
sleep $time
echo ""
echo "Package what is instaled is :
$prog"
}
check_xterm
start
doinstalowania
instal
|
|
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Tue Mar 11, 2014 12:49 pm Post subject: |
|
|
Code: | cat mysavedworld | xargs -I {} emerge --noreplace {} |
? |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8708 Location: ~Brussels - Belgique
|
Posted: Tue Mar 11, 2014 1:07 pm Post subject: |
|
|
or Code: | emerge --noreplace $(cat mysavedworld) |
_________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6097 Location: Dallas area
|
Posted: Tue Mar 11, 2014 1:09 pm Post subject: |
|
|
I just set up this in cron
Code: | /usr/bin/equery l "*" >/n/tmp/portage.installed |
to run every morning to keep track of what's installed as of when it was done. _________________ PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
|