function to remove ipfs

This commit is contained in:
Bob Mottram 2016-07-03 22:00:09 +01:00
parent c42e5eaa30
commit 8df611b0f9
2 changed files with 19 additions and 1 deletions

View File

@ -55,7 +55,6 @@ function remove_gogs {
drop_database gogs drop_database gogs
rm /etc/systemd/system/gogs.service rm /etc/systemd/system/gogs.service
rm -rf $GOPATH/src/github.com/gogits rm -rf $GOPATH/src/github.com/gogits
userdel -r git
sed -i '/install_gogs/d' $COMPLETION_FILE sed -i '/install_gogs/d' $COMPLETION_FILE
sed -i '/Gogs /d' $COMPLETION_FILE sed -i '/Gogs /d' $COMPLETION_FILE
} }

View File

@ -32,6 +32,25 @@ IPFS_GO_REPO="https://github.com/ipfs/go-ipfs"
IPFS_COMMIT='20b06a4cbce8884f5b194da6e98cb11f2c77f166' IPFS_COMMIT='20b06a4cbce8884f5b194da6e98cb11f2c77f166'
IPFS_PORT=4001 IPFS_PORT=4001
function remove_ipfs {
if ! grep -Fxq "install_ipfs" $COMPLETION_FILE; then
return
fi
function_check select_go_version
select_go_version
systemctl stop ipfs
systemctl disable ipfs
systemctl daemon-reload
rm /etc/systemd/system/ipfs.service
rm -rf $GOPATH/src/github.com/ipfs
iptables -D INPUT -p tcp --dport $IPFS_PORT -j ACCEPT
function_check save_firewall_settings
save_firewall_settings
sed -i '/install_ipfs/d' $COMPLETION_FILE
sed -i '/ipfs /d' $COMPLETION_FILE
sed -i '/configure_firewall_for_ipfs/d' $COMPLETION_FILE
}
function configure_firewall_for_ipfs { function configure_firewall_for_ipfs {
if [[ $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CHAT" ]]; then if [[ $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CHAT" ]]; then
return return