Linuxsys
17-09-2004, 22:56
#!/bin/bash
datum='date +%Y''%m''%d'
who='whoami'
if [ "/usr/bin/wget" ];then
cd $HOME
echo "Using wget for getting the tar file"
if [ "$HOME/aMule-cvs-$datum.tar.bz2" ]
then
echo "File exists - will not download the file again^^"
else
wget http://amule.hirnriss.net/cvs/aMule-cvs-$datum.tar.bz2
fi
if [ "$HOME/amule-cvs" ];then
rm -Rf $HOME/amule-cvs
echo "Deleting old amule directory for preventing Bugs through old data"
if [ "aMule-cvs-$datum.tar.bz2" ];then
echo "Unpacking source"
tar jxf aMule-cvs-$datum.tar.bz2 -C $HOME
cd $HOME/amule-cvs
nohup $HOME/amule-cvs/autogen.sh
echo "Running autogen.sh -- see autogen.sh for a log file!"
mv $HOME/amule-cvs/nohup.out $HOME/amule-cvs/autogensh.txt
cd $HOME/amule-cvs
echo "Configuring for debugging, disabled optimizations and enabled the graphical client -- see configure.txt for a log"
nohup $HOME/amule-cvs/configure --prefix=/usr --enable-debug --disable-optimize --enable-amulecmdgui
mv $HOME/amule-cvs/nohup.out $HOME/amule-cvs/configure.txt
cd $HOME/amule-cvs
echo "Running make, see make.txt for a log!"
nohup make -C $HOME/amule-cvs
mv nohup.out make.txt
if [ "$who" != "root" ];then
echo "Using sudo to make install, logging to install.txt"
sudo nohup make -C $HOME/amule-cvs install
mv nohup.out install.txt
else
echo "Doing make install"
nohup make -C $HOME/amule-cvs install
mv nohup.out install.txt
exit
fi
fi
fi
fi
Erstes Problem ist:
if [ "$HOME/aMule-cvs-$datum.tar.bz2" ]
then
echo "File exists - will not download the file again^^"
else
wget http://amule.hirnriss.net/cvs/aMule-cvs-$datum.tar.bz2
fi
Irgendwie macht der das nicht....
Zweites Problem ist:
nohup gibt ständig diese nervende Meldung aus, dass das alles in nohup.out gespeichert wird - kann man das unterdrücken?
Drittes Problem ist die zweite else Schleife:
if [ "$who" != "root" ];then
echo "Using sudo to make install, logging to install.txt"
sudo nohup make -C $HOME/amule-cvs install
mv nohup.out install.txt
else
echo "Doing make install"
nohup make -C $HOME/amule-cvs install
mv nohup.out install.txt
...
Das geht auch nicht - wo liegt der Fehler?
Gebt einem Anfänger mal Hilfe... :confused:
datum='date +%Y''%m''%d'
who='whoami'
if [ "/usr/bin/wget" ];then
cd $HOME
echo "Using wget for getting the tar file"
if [ "$HOME/aMule-cvs-$datum.tar.bz2" ]
then
echo "File exists - will not download the file again^^"
else
wget http://amule.hirnriss.net/cvs/aMule-cvs-$datum.tar.bz2
fi
if [ "$HOME/amule-cvs" ];then
rm -Rf $HOME/amule-cvs
echo "Deleting old amule directory for preventing Bugs through old data"
if [ "aMule-cvs-$datum.tar.bz2" ];then
echo "Unpacking source"
tar jxf aMule-cvs-$datum.tar.bz2 -C $HOME
cd $HOME/amule-cvs
nohup $HOME/amule-cvs/autogen.sh
echo "Running autogen.sh -- see autogen.sh for a log file!"
mv $HOME/amule-cvs/nohup.out $HOME/amule-cvs/autogensh.txt
cd $HOME/amule-cvs
echo "Configuring for debugging, disabled optimizations and enabled the graphical client -- see configure.txt for a log"
nohup $HOME/amule-cvs/configure --prefix=/usr --enable-debug --disable-optimize --enable-amulecmdgui
mv $HOME/amule-cvs/nohup.out $HOME/amule-cvs/configure.txt
cd $HOME/amule-cvs
echo "Running make, see make.txt for a log!"
nohup make -C $HOME/amule-cvs
mv nohup.out make.txt
if [ "$who" != "root" ];then
echo "Using sudo to make install, logging to install.txt"
sudo nohup make -C $HOME/amule-cvs install
mv nohup.out install.txt
else
echo "Doing make install"
nohup make -C $HOME/amule-cvs install
mv nohup.out install.txt
exit
fi
fi
fi
fi
Erstes Problem ist:
if [ "$HOME/aMule-cvs-$datum.tar.bz2" ]
then
echo "File exists - will not download the file again^^"
else
wget http://amule.hirnriss.net/cvs/aMule-cvs-$datum.tar.bz2
fi
Irgendwie macht der das nicht....
Zweites Problem ist:
nohup gibt ständig diese nervende Meldung aus, dass das alles in nohup.out gespeichert wird - kann man das unterdrücken?
Drittes Problem ist die zweite else Schleife:
if [ "$who" != "root" ];then
echo "Using sudo to make install, logging to install.txt"
sudo nohup make -C $HOME/amule-cvs install
mv nohup.out install.txt
else
echo "Doing make install"
nohup make -C $HOME/amule-cvs install
mv nohup.out install.txt
...
Das geht auch nicht - wo liegt der Fehler?
Gebt einem Anfänger mal Hilfe... :confused: