From 75831a57202b315767038aa535b4045c5bc3c43f Mon Sep 17 00:00:00 2001 From: XanderWatson Date: Mon, 28 Aug 2023 10:01:50 +0530 Subject: [PATCH] Removes postinstall script from aur and updates README --- .goreleaser.yml | 2 -- README.md | 69 +++++++++++++++++++++++++++++++++++++++- aur-post-install.install | 15 --------- 3 files changed, 68 insertions(+), 18 deletions(-) delete mode 100644 aur-post-install.install diff --git a/.goreleaser.yml b/.goreleaser.yml index 0498004..ce12f4b 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -81,7 +81,6 @@ aurs: install -Dm755 "./scripts/linux/login.sh" "${pkgdir}/usr/bin/autoproxylogin" install -Dm755 "./scripts/linux/daemon-start.sh" "${pkgdir}/usr/bin/autoproxyd-start" install -Dm755 "./scripts/linux/daemon-stop.sh" "${pkgdir}/usr/bin/autoproxyd-stop" - install -Dm755 "./aur-post-install.install" "${pkgdir}/../../aur-post-install.install" install -Dm644 "./LICENSE" "${pkgdir}/usr/share/licenses/iitj-autoproxy/LICENSE" install -Dm644 "./base_config.json" "${pkgdir}/etc/iitj-autoproxy/autoproxy.config" install -Dm644 "./README.md" "${pkgdir}/usr/share/doc/iitj-autoproxy/README.md" @@ -96,4 +95,3 @@ archives: - README.md - base_config.json - scripts/* - - aur-post-install.install diff --git a/README.md b/README.md index 5669466..ab99696 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,78 @@ A CLI tool to automatically login to IIT Jodhpur's network firewall. #### (Currently only supports Linux) -### Installation (Debian-based Linux Distributions only) +### Installation + +#### Debian-based Linux Distributions: +- Run the following commands to install the package: + ``` $ curl -s https://packagecloud.io/install/repositories/XanderWatson/iitj-autoproxy/script.deb.sh | sudo bash $ sudo apt update $ sudo apt install iitj-autoproxy ``` +- The daemon service will be started automatically. Incase it doesn't, run the following command: + +``` +$ sudo autoproxyd-start +``` + +- To stop the daemon service, run the following command: + +``` +$ sudo autoproxyd-stop +``` + +#### Arch-based Linux Distributions: +- Install the [AUR package](https://aur.archlinux.org/packages/iitj-autoproxy-bin/) using your favourite AUR helper. + +For example, using `yay`: +``` +$ yay -S iitj-autoproxy-bin +``` + +- Start the daemon service: + +``` +$ sudo autoproxyd-start +``` + +- To stop the daemon service, run the following command: + +``` +$ sudo autoproxyd-stop +``` + +### Usage + +- First, you need to set your username and password. To do so, run the following command: + +``` +$ autoproxy config +``` + +- Enter your username and password when prompted. + + +- To login to the firewall once, run the following command: + +``` +$ autoproxy login +``` + +- To automatically login to the firewall everytime it is required, run the following command: + +``` +$ autoproxy schedule +``` + +Note: You need to be logged out before running the above command. + +- To logout from the firewall, run the following command: + +``` +$ autoproxy logout +``` + #### Support for other operating systems coming soon :) diff --git a/aur-post-install.install b/aur-post-install.install deleted file mode 100644 index cfcdb46..0000000 --- a/aur-post-install.install +++ /dev/null @@ -1,15 +0,0 @@ -post_install() { - # This script is used to start the daemon after installation - - echo "Performing post-install actions..." - - TARGET_USER=$(who | awk '{if ($1 != "root") print $1; exit;}') - - su - $TARGET_USER -c /usr/bin/autoproxyd >/dev/null 2>&1 & - - APP_PID=$! - - echo $APP_PID >/run/autoproxyd.pid - - disown $APP_PID -}