diff --git a/README.md b/README.md new file mode 100644 index 0000000..e196726 --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# NNOS: Making Linux Easier (Also Works on Windows) + +## Overview + +Welcome to **NNOS**, your friendly companion for navigating the world of Linux (and yes, it plays well with Windows too!). Whether you're a seasoned command-line guru or just dipping your toes into the terminal waters, **NNOS** is here to make your life easier. + +## Key Features + +1. **Speak Your Mind (Coming Soon)**: Tired of typing? Just say it! **NNOS** understands natural language commands, so go ahead and tell it what you need. Whether it's opening a directory or installing a package, your voice is your superpower. + +2. **Package Magic**: Installing software shouldn't feel like deciphering ancient scrolls. With **NNOS**, package management becomes a breeze. Say goodbye to cryptic commands; just ask for what you want, and watch the magic happen. + +3. **Windows, Meet NNOS**: Windows users, fear not! **NNOS** isn't an exclusive Linux club. It's the bridge between worlds. So whether you're in the penguin-loving camp or the Windows fan club, we've got you covered. + +4. **Learn as You Go (Coming Soon)**: Curious about a command? Just ask! **NNOS** provides helpful explanations, examples, and even a dash of humor. Learning Linux has never been this friendly. +5. ** Everyday comands **: Common commands made easier (making the reboot command nnos restart) +## Installation + +Ready to join the conversation? Here's how to install **NNOS**: + +1. Open your terminal (or PowerShell on Windows). +2. Download NNOS an make sure you are in the same directory as the file +3. Type the following command: +chmod +x nnos;./nnos +4. Once installed, say hello to **NNOS**: + + ```bash + nnos --help + ``` + +## Contributing + +Got ideas? Found a bug? Want to share a Linux meme? Head over to our [GitHub repository](https://github.com/natuworkguy/NNOS) and join the party. We're all ears (and voices)! diff --git a/linux/nnos b/linux/nnos index 463f14c..fa6bc14 100755 --- a/linux/nnos +++ b/linux/nnos @@ -1,36 +1,49 @@ #!/bin/bash + +if [[ $EUID -ne 0 ]]; then + echo "This script must be run as root." + exit 1 +fi + mkdir -p /var/nnos/binarystorage/ -touch /var/nnos/binarystorage/installed > /dev/null/output -if ["$(cat /var/nnos/binarystorage/installed)" == "1"]; then -help() { -echo "Usage: nnos:" -echo "[--help]: Display help information for NNOS" -echo "[--restart]: Restart NNOS, or your machine if needed" -echo "By The Nathan Network, INC™. All rights reserved" -exit 1 -} -help() -case "$OPTION" in +touch /var/nnos/binarystorage/installed >> /var/log/syslog + +OPTION="$1" + +if [ "$(cat /var/nnos/binarystorage/installed)" == "1" ]; then + help() { + echo "Usage: nnos:" + echo "[--help]: Display help information for NNOS" + echo "[--restart]: Restart NNOS, or your machine if needed" + echo "By The Nathan Network, INC™. All rights reserved" + exit 1 + } + + case "$OPTION" in --restart) - reboot - ;; - --shutdown) - poweroff - ;; + reboot + ;; + --shutdown) + poweroff + ;; --help) - help() - ;; - ?) - echo "Usage: nnos: " - exit 1 - ;; -esac + help + ;; + *) + echo "Usage: nnos: " + exit 1 + ;; + esac else -case "$OPTION" in - --install) - echo "1" > /var/nnos/binarystorage/installed - mv "$0" /usr/bin/ - echo 'To use NNOS, call the "$0" command anytime..' - ;; -esac + case "$OPTION" in + --install) + echo "1" > /var/nnos/binarystorage/installed + mv "$0" /usr/bin/ + echo "To use NNOS, call the $(basename $0) command anytime." + ;; + *) + echo "Usage: nnos: " + exit 1 + ;; + esac fi diff --git a/win/run.bat b/win/run.bat index 8b33bf7..3619c2e 100644 --- a/win/run.bat +++ b/win/run.bat @@ -1,26 +1,29 @@ #!/bin/bash + help() { -echo "Usage: nnos:" -echo "[--help]: Display help information for NNOS" -echo "[--restart]: Restart NNOS, or your machine if needed" -echo "By The Nathan Network, INC™. All rights reserved" -exit 1 + echo "Usage: nnos:" + echo "[--help]: Display help information for NNOS" + echo "[--restart]: Restart NNOS, or your machine if needed" + echo "By The Nathan Network, INC™. All rights reserved" + exit 1 } + hx() { -echo "Usage: nnos: " + echo "Usage: nnos: " } +hx() case "$OPTION" in - --restart) - reboot - ;; - --shutdown) - poweroff - ;; - --help) - help() - ;; - ?) - hx + --restart) + reboot + ;; + --shutdown) + poweroff + ;; + --help) + help + ;; + ?) + echo "Invalid option. Usage: nnos: " exit 1 ;; esac