projects
/
scripts
/
scripts.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hostname argv[1]
[scripts/scripts.git]
/
fai_backup.sh
diff --git
a/fai_backup.sh
b/fai_backup.sh
index
314f053
..
95d4327
100755
(executable)
--- a/
fai_backup.sh
+++ b/
fai_backup.sh
@@
-4,7
+4,7
@@
configcp() {
file=$1
mkdir -p $configdir/$file
configcp() {
file=$1
mkdir -p $configdir/$file
-
cp -
v $file $configdir/$file/$myip
+
rsync -a
v $file $configdir/$file/$myip
}
backupcp() {
cat=$1
}
backupcp() {
cat=$1
@@
-30,7
+30,11
@@
backupdir="/mnt/tmp2"
# initializing custom variables
host=`hostname`
# initializing custom variables
host=`hostname`
-myip="`host $host | awk '{ print $4 }'`"
+if [ -z $1 ] ; then
+ myip="`host $host | awk '{ print $4 }'`"
+else
+ myip=$1
+fi
res=$?
if [ "$res" != "0" ] ; then
echo "unable to determine the hosts ip address"
res=$?
if [ "$res" != "0" ] ; then
echo "unable to determine the hosts ip address"
@@
-64,8
+68,8
@@
else
fi
# config:
fi
# config:
-for configfile in /usr/src/
kernel/*
config; do
- configcp $configfile
+for configfile in /usr/src/
linux/.
config; do
+
[ -f $configfile ] &&
configcp $configfile
done
for onefile in profile network kernel wireless; do
configfile="/etc/conf/$onefile"
done
for onefile in profile network kernel wireless; do
configfile="/etc/conf/$onefile"