Skip to content

Instantly share code, notes, and snippets.

@tavinus
Last active December 22, 2024 00:21
Show Gist options
  • Select an option

  • Save tavinus/08a63e7269e0f70d27b8fb86db596f0d to your computer and use it in GitHub Desktop.

Select an option

Save tavinus/08a63e7269e0f70d27b8fb86db596f0d to your computer and use it in GitHub Desktop.

Revisions

  1. tavinus revised this gist Jan 26, 2023. No changes.
  2. tavinus revised this gist Jan 26, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion rem_proxmox_popup.sh
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@
    # Will disable the annoying login message about
    # missing subscription.
    #
    # Tested on Proxmox PVE v5.2-1 / v6.0-4 / v6.3-2 / 7.2-11
    # Tested on Proxmox PVE v5.2-1 / v6.0-4 / v6.3-2 / 7.2-11 / 7.3-4
    #
    # The sed command will create a backup of the changed file.
    # There is no guarantee that this will work for future versions.
  3. tavinus revised this gist Oct 29, 2022. 1 changed file with 5 additions and 10 deletions.
    15 changes: 5 additions & 10 deletions rem_proxmox_popup.sh
    Original file line number Diff line number Diff line change
    @@ -49,16 +49,11 @@ SEDBIN="$(which sed)"

    [ -x "$SEDBIN" ] || init_error "Could not find 'sed' binary, aborting..."

    r=0

    # This will also create a .bak file with the original file contents
    sed -i.bak 's/NotFound/Active/g' "$TGTPATH/$TGTFILE" && sed -i.bak 's/notfound/active/g' "$TGTPATH/$TGTFILE" || ((r++))
    $PVEPXYRESTART || ((r++))
    sed -i.bak 's/NotFound/Active/g' "$TGTPATH/$TGTFILE"
    sed -i.bak 's/notfound/active/g' "$TGTPATH/$TGTFILE"
    $PVEPXYRESTART

    if [ $r -eq 0 ]; then
    printf "%s\n" "All done! Please refresh your browser and test the changes!"
    exit 0
    fi
    # Removed execution checking, since the terminal gets closed after PVEPXYRESTART anyways

    printf "%s\n" "An error was detected! Changes may not have been applied!"
    exit 1
    exit 0
  4. tavinus revised this gist Oct 22, 2022. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions rem_proxmox_popup.sh
    Original file line number Diff line number Diff line change
    @@ -52,8 +52,7 @@ SEDBIN="$(which sed)"
    r=0

    # This will also create a .bak file with the original file contents
    sed -i.bak 's/NotFound/Active/g' "$TGTPATH/$TGTFILE" || ((r++))
    sed -i.bak 's/notfound/active/g' "$TGTPATH/$TGTFILE" || ((r++))
    sed -i.bak 's/NotFound/Active/g' "$TGTPATH/$TGTFILE" && sed -i.bak 's/notfound/active/g' "$TGTPATH/$TGTFILE" || ((r++))
    $PVEPXYRESTART || ((r++))

    if [ $r -eq 0 ]; then
  5. tavinus revised this gist Oct 20, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion rem_proxmox_popup.sh
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@
    # Will disable the annoying login message about
    # missing subscription.
    #
    # Tested on Proxmox PVE v5.2-1 / v6.0-4 / v6.3-2
    # Tested on Proxmox PVE v5.2-1 / v6.0-4 / v6.3-2 / 7.2-11
    #
    # The sed command will create a backup of the changed file.
    # There is no guarantee that this will work for future versions.
  6. tavinus revised this gist Oct 20, 2022. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions rem_proxmox_popup.sh
    Original file line number Diff line number Diff line change
    @@ -49,10 +49,13 @@ SEDBIN="$(which sed)"

    [ -x "$SEDBIN" ] || init_error "Could not find 'sed' binary, aborting..."

    r=0

    # This will also create a .bak file with the original file contents
    sed -i.bak 's/NotFound/Active/g' "$TGTPATH/$TGTFILE" && $PVEPXYRESTART
    sed -i.bak 's/NotFound/Active/g' "$TGTPATH/$TGTFILE" || ((r++))
    sed -i.bak 's/notfound/active/g' "$TGTPATH/$TGTFILE" || ((r++))
    $PVEPXYRESTART || ((r++))

    r=$?
    if [ $r -eq 0 ]; then
    printf "%s\n" "All done! Please refresh your browser and test the changes!"
    exit 0
  7. tavinus revised this gist Dec 3, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion rem_proxmox_popup.sh
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@
    # Will disable the annoying login message about
    # missing subscription.
    #
    # Tested on Proxmox PVE v5.2-1 and v6.0-4
    # Tested on Proxmox PVE v5.2-1 / v6.0-4 / v6.3-2
    #
    # The sed command will create a backup of the changed file.
    # There is no guarantee that this will work for future versions.
  8. tavinus revised this gist Dec 3, 2020. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions rem_proxmox_popup.sh
    Original file line number Diff line number Diff line change
    @@ -18,6 +18,13 @@
    # wget -q -O - 'https://gist.github.com/tavinus/08a63e7269e0f70d27b8fb86db596f0d/raw/' | /bin/sh
    # curl -L -s 'https://gist.github.com/tavinus/08a63e7269e0f70d27b8fb86db596f0d/raw/' | /bin/sh
    #
    # Save to Local File:
    # wget -q -O rem_proxmox_popup.sh 'https://gist.github.com/tavinus/08a63e7269e0f70d27b8fb86db596f0d/raw/' && chmod +x rem_proxmox_popup.sh
    # curl -L -o rem_proxmox_popup.sh 'https://gist.github.com/tavinus/08a63e7269e0f70d27b8fb86db596f0d/raw/' && chmod +x rem_proxmox_popup.sh
    #
    # Then you can just run the file after updates:
    # ./rem_proxmox_popup.sh
    #
    #######################################################

    init_error() {
  9. tavinus revised this gist Jul 26, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion rem_proxmox_popup.sh
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@
    # Will disable the annoying login message about
    # missing subscription.
    #
    # Tested on Proxmox PVE 5.2-1
    # Tested on Proxmox PVE v5.2-1 and v6.0-4
    #
    # The sed command will create a backup of the changed file.
    # There is no guarantee that this will work for future versions.
  10. tavinus revised this gist May 28, 2018. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions rem_proxmox_popup.sh
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,10 @@
    #
    # Tested on Proxmox PVE 5.2-1
    #
    # The sed command will create a backup of the changed file.
    # There is no guarantee that this will work for future versions.
    # Use at your own risk!
    #
    # OneLiner:
    # wget -q -O - 'https://gist.github.com/tavinus/08a63e7269e0f70d27b8fb86db596f0d/raw/' | /bin/sh
    # curl -L -s 'https://gist.github.com/tavinus/08a63e7269e0f70d27b8fb86db596f0d/raw/' | /bin/sh
  11. tavinus revised this gist May 28, 2018. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions rem_proxmox_popup.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    #!/bin/sh

    #######################################################
    #
    # Edits the proxmox Subscription file to make it
    # think that it has a Subscription.
    #
  12. tavinus revised this gist May 28, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion rem_proxmox_popup.sh
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@ TGTFILE='Subscription.pm'
    # Check dependecies
    SEDBIN="$(which sed)"

    [[ -x "$SEDBIN" ]] || init_error "Could not find 'sed' binary, aborting..."
    [ -x "$SEDBIN" ] || init_error "Could not find 'sed' binary, aborting..."

    # This will also create a .bak file with the original file contents
    sed -i.bak 's/NotFound/Active/g' "$TGTPATH/$TGTFILE" && $PVEPXYRESTART
  13. tavinus revised this gist May 28, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions rem_proxmox_popup.sh
    Original file line number Diff line number Diff line change
    @@ -10,8 +10,8 @@
    # Tested on Proxmox PVE 5.2-1
    #
    # OneLiner:
    # wget -O - (URL) | /bin/sh
    # curl -s (URL) | /bin/sh
    # wget -q -O - 'https://gist.github.com/tavinus/08a63e7269e0f70d27b8fb86db596f0d/raw/' | /bin/sh
    # curl -L -s 'https://gist.github.com/tavinus/08a63e7269e0f70d27b8fb86db596f0d/raw/' | /bin/sh
    #
    #######################################################

  14. tavinus created this gist May 28, 2018.
    50 changes: 50 additions & 0 deletions rem_proxmox_popup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,50 @@
    #!/bin/sh

    #######################################################
    # Edits the proxmox Subscription file to make it
    # think that it has a Subscription.
    #
    # Will disable the annoying login message about
    # missing subscription.
    #
    # Tested on Proxmox PVE 5.2-1
    #
    # OneLiner:
    # wget -O - (URL) | /bin/sh
    # curl -s (URL) | /bin/sh
    #
    #######################################################

    init_error() {
    local ret=1
    [ -z "$1" ] || printf "%s\n" "$1"
    [ -z "$2" ] || ret=$2
    exit $ret
    }

    # Original command
    # sed -i.bak 's/NotFound/Active/g' /usr/share/perl5/PVE/API2/Subscription.pm && systemctl restart pveproxy.service

    # Command to restart PVE Proxy and apply changes
    PVEPXYRESTART='systemctl restart pveproxy.service'

    # File/folder to be changed
    TGTPATH='/usr/share/perl5/PVE/API2'
    TGTFILE='Subscription.pm'

    # Check dependecies
    SEDBIN="$(which sed)"

    [[ -x "$SEDBIN" ]] || init_error "Could not find 'sed' binary, aborting..."

    # This will also create a .bak file with the original file contents
    sed -i.bak 's/NotFound/Active/g' "$TGTPATH/$TGTFILE" && $PVEPXYRESTART

    r=$?
    if [ $r -eq 0 ]; then
    printf "%s\n" "All done! Please refresh your browser and test the changes!"
    exit 0
    fi

    printf "%s\n" "An error was detected! Changes may not have been applied!"
    exit 1