-
Notifications
You must be signed in to change notification settings - Fork 1
/
bitcrystal_conf_update_ubuntu.sh
executable file
·46 lines (45 loc) · 1.52 KB
/
bitcrystal_conf_update_ubuntu.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
rootpath=$HOME
mypath=./
bitcrystalpath=${rootpath}'/.bitcrystal_v20'
bitcrystalconf=${bitcrystalpath}'/bitcrystal.conf'
OS="UBUNTU"
OS_VERSION="7.0"
PREFIX=""
if [[ $OS == "UBUNTU" ]]; then
PREFIX="sudo"
fi
WHOAMI_ROOT=$($PREFIX id -u);
if [ $WHOAMI_ROOT -ne 0 ]; then
echo "Are you running this script under root?"
exit 0;
fi
$PREFIX echo start updating bitcrystal.conf
$PREFIX echo just a momment please...
$PREFIX echo;
$PREFIX echo;
$PREFIX echo;
if [ ! -d $bitcrystalpath ]; then
$PREFIX mkdir $bitcrystalpath
$PREFIX chmod 755 $bitcrystalpath -R
$PREFIX chown $(whoami):$(whoami) $bitcrystalpath -R
fi
if [ ! -f $bitcrystalconf ]; then
if [ ! -f ${mypath}'/bitcrystal.conf' ]; then
$PREFIX wget http://bitcrystaldownload.demon-craft.de/bitcrystal_conf_update/bitcrystal.conf
$PREFIX cat ${mypath}'/bitcrystal.conf' > ${bitcrystalconf}
$PREFIX chmod 755 $bitcrystalconf
$PREFIX chown $(whoami):$(whoami) $bitcrystalconf
else
$PREFIX cat ${mypath}'/bitcrystal.conf' > ${bitcrystalconf}
$PREFIX chmod 755 $bitcrystalconf
$PREFIX chown $(whoami):$(whoami) $bitcrystalconf
fi
fi
$PREFIX cp $bitcrystalconf /tmp
$PREFIX rm ${mypath}'bitcrystal_conf_update.txt' 1> /dev/null 2> /dev/null
$PREFIX wget http://bitcrystaldownload.demon-craft.de/bitcrystal_conf_update/bitcrystal_conf_update.txt
$PREFIX cat /tmp/bitcrystal.conf ${mypath}'bitcrystal_conf_update.txt' > $bitcrystalconf
$PREFIX rm /tmp/bitcrystal.conf
$PREFIX chmod 755 $bitcrystalconf
$PREFIX chown $(whoami):$(whoami) $bitcrystalconf