You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

66 lines
2.4 KiB

#!/bin/bash
########################################################################
# Version: 0.3
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
{
[ $(id -u) -eq 0 ] && echo "LANCEMENT root INTERDIT. Utilisez un simple utilisateur du groupe \"sudo\" SVP" && exit 1
########################################################################
echo "DISABLE ipfs"
if [[ "$USER" == "xbian" ]]
then
mv /etc/rc2.d/S02ipfs /etc/rc2.d/K01ipfs
mv /etc/rc3.d/S02ipfs /etc/rc3.d/K01ipfs
mv /etc/rc4.d/S02ipfs /etc/rc4.d/K01ipfs
mv /etc/rc5.d/S02ipfs /etc/rc5.d/K01ipfs
else
# DISABLE ipfs
sudo systemctl disable ipfs
sudo systemctl daemon-reload
fi
########################################################################
# RESTORE OLD KODI
[[ -e ~/.kodi.old ]] && echo "RESTORE KODI" && rm -Rf ~/.kodi && mv ~/.kodi.old ~/.kodi
########################################################################
## ERASE GCHANGE+ STARS
echo "REMOVE STAR TO BOOTSTRAP NODES"
for bootnode in $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#") # remove comments
do
if [[ $bootnode != "" ]]; then
ipfsnodeid=${bootnode##*/}
g1node=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $ipfsnodeid)
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" unstars -p $g1node
## RM BOOTSTRAP
ipfs bootstrap rm $bootnode
fi
done
########################################################################
echo "ERASE GCHANGE/CESIUM+ PROFILES"
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" erase
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://g1.data.e-is.pro" erase
########################################################################
echo "REMOVE cron_MINUTE from CRONTAB"
crontab -l > /tmp/mycron
# Remove any previous line containing "cron_MINUTE"
awk -i inplace -v rmv="cron_MINUTE" '!index($0,rmv)' /tmp/mycron
crontab /tmp/newcron
rm -f /tmp/mycron
########################################################################
echo "REMOVE /etc/sudoers EXTRA PERMISSION"
[[ "$USER" == "xbian" ]] && rm -f /etc/sudoers.d/astroport
rm -f /etc/sudoers.d/fail2ban-client
rm -f /etc/sudoers.d/mount
rm -f /etc/sudoers.d/umount
rm -f /etc/sudoers.d/apt-get
rm -f /etc/sudoers.d/apt
rm -f /etc/sudoers.d/systemctl
echo "UNINSTALL FINISH, PLEASE REMOVE ~/.zen.todelete"
mv ~/.zen ~/.zen.todelete
}