Hi repzeroworld,
Just don't give the full path to adstar folder. Take a look:
Code:
root@kali:~/root# ls
adstar Desktop
root@kali:~/root# tar -cvf adstar.tar adstar
adstar/
adstar/adstar-HOW TOS.txt
adstar/adstar.sh
adstar/adstar
but if you do:
Code:
root@kali:~# ls
adstar Desktop
root@kali:~# tar -cvf adstar.tar /root/adstar
tar: Removing leading `/' from member names
/root/adstar/
/root/adstar/adstar-HOW TOS.txt
/root/adstar/adstar.sh
/root/adstar/adstar
and if you extract adstar.tar then the extracted contents will placed at parent directory plus /root/adstar/.
if you want better compression ration you can use bz2 algorithm:
Code:
tar cjf adstart.tar.bz2 adstar
also you can change this:
Code:
##Let's see...determine my working directory
script_dir=`dirname "$0"`;
if [ -e "$script_dir/adstar" ];then
cd ~;
cp -f "$script_dir/adstar" /etc/;
fi
if [ ! -e "$script_dir/adstar" ];then
echo "Exiting...adstar program not found within this script's directory";
exit
fi
....
.....
to this:
Code:
#!/bin/bash
##Let's see...determine my working directory
script_dir=`pwd`
if [ -e "$script_dir" ];then
cp -f "$script_dir/adstar" /etc/adstar
else
echo "Exiting...adstar program not found within this script's directory"
exit 1
fi
##adding directory path to .bashrc file
path_check=`cat /root/.bashrc| grep -F 'export PATH=/etc:$PATH'`
if [ -n "$path_check" ]; then
echo -e "\e[32m\e[1mexisting adstar path found...."
sleep 1
echo "continuing..."
sleep 1
else
echo "export PATH=/etc:"$PATH"" >> /root/.bashrc
source /root/.bashrc
fi
echo "Successful!...."
echo "To use adstar type 'adstar <command line>' in terminal!"
###
basically it's almost the same thing but I like it most this way