|
@@ -10,7 +10,12 @@ cifs_i=0
|
|
retry_flag=0
|
|
retry_flag=0
|
|
daemon_on=0
|
|
daemon_on=0
|
|
split_size=300
|
|
split_size=300
|
|
-
|
|
|
|
|
|
+OSV=$(sed 's/\..*//' /etc/debian_version)
|
|
|
|
+DietPi_="NO"
|
|
|
|
+if [ $OSV = 8 ];then img_v="Jessie";fi
|
|
|
|
+if [ $OSV = 9 ];then img_v="Strecth"; fi
|
|
|
|
+if [ $OSV = 10 ];then img_v="Buster"; fi
|
|
|
|
+if [ $OSV = 11 ];then img_v="Bullseye"; fi
|
|
echo -e "$(tput setaf 5)"
|
|
echo -e "$(tput setaf 5)"
|
|
echo -e " ╔╗ ╔═╗╔═╗╔╦╗╔═╗╔╦╗╦═╗╔═╗╔═╗"
|
|
echo -e " ╔╗ ╔═╗╔═╗╔╦╗╔═╗╔╦╗╦═╗╔═╗╔═╗"
|
|
echo -e " ╠╩╗║ ║║ ║ ║ ╚═╗ ║ ╠╦╝╠═╣╠═╝"
|
|
echo -e " ╠╩╗║ ║║ ║ ║ ╚═╗ ║ ╠╦╝╠═╣╠═╝"
|
|
@@ -22,12 +27,15 @@ echo -e ""
|
|
echo -e "\e[97mOkcash Blockchain Uploader v$version ($date)\e[0m"
|
|
echo -e "\e[97mOkcash Blockchain Uploader v$version ($date)\e[0m"
|
|
echo -e "Author : wareck@gmail.com"
|
|
echo -e "Author : wareck@gmail.com"
|
|
echo -e ""
|
|
echo -e ""
|
|
|
|
+echo -e "Raspbian : $img_v"
|
|
echo -e "Upload : Mega.nz"
|
|
echo -e "Upload : Mega.nz"
|
|
echo -e "Format : tar.xz"
|
|
echo -e "Format : tar.xz"
|
|
echo -e "Packet Size : $split_size Mo"
|
|
echo -e "Packet Size : $split_size Mo"
|
|
echo -e ""
|
|
echo -e ""
|
|
sleep 4
|
|
sleep 4
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
function init {
|
|
function init {
|
|
if ps -ef | grep -v grep | grep okcashd >/dev/null
|
|
if ps -ef | grep -v grep | grep okcashd >/dev/null
|
|
then
|
|
then
|
|
@@ -48,7 +56,17 @@ echo -e "\n\e[93mStopping watchdog :\e[0m"
|
|
sudo systemctl stop watchdog >/dev/null
|
|
sudo systemctl stop watchdog >/dev/null
|
|
echo "Done."
|
|
echo "Done."
|
|
fi
|
|
fi
|
|
-if [ -d /home/$USER/scripts/ledstatus/ ];then sudo python /home/$USER/scripts/ledstatus/led_off.py; fi
|
|
|
|
|
|
+
|
|
|
|
+if [ -d /home/$USER/scripts/ledstatus/ ]
|
|
|
|
+then
|
|
|
|
+case $OSV in
|
|
|
|
+11)
|
|
|
|
+sudo python3 /home/$USER/scripts/ledstatus/led_off.py ;;
|
|
|
|
+*)
|
|
|
|
+sudo python /home/$USER/scripts/ledstatus/led_off.py ;;
|
|
|
|
+esac
|
|
|
|
+fi
|
|
|
|
+
|
|
if [ -f /var/swap ]
|
|
if [ -f /var/swap ]
|
|
then
|
|
then
|
|
echo -e "\n\e[93mStopping Swap :\e[0m"
|
|
echo -e "\n\e[93mStopping Swap :\e[0m"
|
|
@@ -136,22 +154,12 @@ fi
|
|
function packit {
|
|
function packit {
|
|
echo -e "\n\e[95mPacking & Compressing Files :\e[0m"
|
|
echo -e "\n\e[95mPacking & Compressing Files :\e[0m"
|
|
cd /home/$USER
|
|
cd /home/$USER
|
|
-#SIZE1=`du -sk /home/$USER/.okcash/blk0001.dat | cut -f 1`
|
|
|
|
-#SIZE2=`du -sk /home/$USER/.okcash/txleveldb/ | cut -f 1`
|
|
|
|
-#SIZET=$(($SIZE2+$SIZE1))
|
|
|
|
-#echo -e "\e[97mTar & PiXz bootstrap.tar.xz:\e[0m"
|
|
|
|
echo -e "\e[97mCompress & split bootstrap.7z:\e[0m"
|
|
echo -e "\e[97mCompress & split bootstrap.7z:\e[0m"
|
|
split_size="${split_size}m"
|
|
split_size="${split_size}m"
|
|
-7z a -v$split_size bootstrap .okcash/blk0001.dat .okcash/txleveldb/
|
|
|
|
|
|
+7z a -m0=lzma -mx9 -mfb=64 -md32m -v$split_size bootstrap .okcash/blk0001.dat .okcash/txleveldb/
|
|
sleep 1
|
|
sleep 1
|
|
echo "Done."
|
|
echo "Done."
|
|
|
|
|
|
-#echo -e "\n\e[95mSplitting Files (${split_size}M):\e[0m"
|
|
|
|
-#split --verbose --numeric-suffixes=1 -b ${split_size}M bootstrap.tar.xz "bootstrap.part"
|
|
|
|
-#rm bootstrap.tar.xz
|
|
|
|
-#sleep 1
|
|
|
|
-#echo "Done."
|
|
|
|
-
|
|
|
|
echo -e "\n\e[95mMake bootstrap_v.txt:\e[0m"
|
|
echo -e "\n\e[95mMake bootstrap_v.txt:\e[0m"
|
|
if [ -f bootstrap_v.txt ]; then rm bootstrap_v.txt;fi
|
|
if [ -f bootstrap_v.txt ]; then rm bootstrap_v.txt;fi
|
|
Raw_date="`date +%d.%m.%Y`"
|
|
Raw_date="`date +%d.%m.%Y`"
|