Sam Chiu | 81bdc65 | 2018-06-29 18:45:08 +0800 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | function remove_cuttlefish_pkg() { |
| 4 | echo "uninstalling cuttlefish-common" |
| 5 | sudo su -c "apt-get purge cuttlefish-common -y && apt-get autoremove -y" |
| 6 | } |
| 7 | |
| 8 | function remove_cuttlefish_usergroup() { |
| 9 | local GROUPS_TO_REMOVE=("kvm" "libvirt" "cvdnetwork") |
| 10 | echo "remove user from groups: ${GROUPS_TO_REMOVE[@]}" |
| 11 | for g in ${GROUPS_TO_REMOVE[@]}; |
| 12 | do |
| 13 | sudo gpasswd -d $USER $g |
| 14 | done |
| 15 | su - $USER |
| 16 | } |
| 17 | |
| 18 | function purge_cuttlefish(){ |
| 19 | remove_cuttlefish_pkg |
| 20 | remove_cuttlefish_usergroup |
| 21 | echo 'purge cuttlefish finish!' |
| 22 | } |
| 23 | |
| 24 | purge_cuttlefish |